This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#226 2011-07-22 09:13:15

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Hmm, most people use sigs to talk about themselves, advertise something they've done, or advertise something a specific Scratcher has done that they liked. I think a few people might have a "unseen project of the day" sort of thing going but there isn't much call for it...


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#227 2011-07-22 09:14:20

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

Hmm, most people use sigs to talk about themselves, advertise something they've done, or advertise something a specific Scratcher has done that they liked. I think a few people might have a "unseen project of the day" sort of thing going but there isn't much call for it...

Hmm... Well, I could do random project or user, but, I guess...


http://i46.tinypic.com/dw7zft.png

Offline

 

#228 2011-07-22 11:37:37

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

LiquidMetal wrote:

Now that you have started working on the text thing, can you work towards my original request?

LiquidMetal wrote:

Can you make the link say what the project is called, instead of "my newest project."

That is exactly what I'm developing the text editor for! I'm trying to get it to look right at first as it will look odd http://www.blocks.scratchr.org/API.php? … derscores. Once it's done though, I think all the current API's will have a text feature added, e.g. online message, offline message, newest project name(s) newest friend name(s), random text.

Ahh, but you are having trouble with this, and the text will automatically update, so why not do it now?  I understand it is useful to have a set queue though, and not to be working on too many things at once.

Offline

 

#229 2011-07-22 16:32:57

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Alright, I will have a go at getting the project name first!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#230 2011-07-22 16:56:05

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

http://www.blocks.scratchr.org/API.php?action=onlineStatus&type=customText&online=I_am_online_at_the_moment&offline=I_am_offline_at_the_moment


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#231 2011-07-22 17:07:57

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Alright. So the custom online/offline text does not seem to be working....


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#232 2011-07-22 17:22:15

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: ITopic: self-updating images and links in posts!

Can't you just have a image of "I_am" then "offline" then "_at_the_moment"?


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#233 2011-07-22 17:24:11

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

are you still stuck on converting '_' to ' ' ?

I'll work on that for you if you want.


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#234 2011-07-22 17:25:57

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

hello12345678910 wrote:

Can't you just have a image of "I_am" then "offline" then "_at_the_moment"?

I can, but I want people to be able to choose ANY message they want for the message. http://www.blocks.scratchr.org/API.php?action=text&amp;string=See?_Any_message_can_be_typed!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#235 2011-07-22 17:28:04

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

RUMCHEERYPOOPOO wrote:

are you still stuck on converting '_' to ' ' ?

I'll work on that for you if you want.

Yup. Here's what I tried:

Code:

$string = $_GET['string'];
$parser = '';
while ($count < strlen($_GET['string'])){
    if(substr($string, $count, 1) == '_'){
        $parser = $parser . ' ';
    }
    else{
        $parser = $parser . (substr($string, $count, 1));
    }
    $count ++;
}

http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#236 2011-07-22 17:33:40

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

RUMCHEERYPOOPOO wrote:

are you still stuck on converting '_' to ' ' ?

I'll work on that for you if you want.

Yup. Here's what I tried:

Code:

$string = $_GET['string'];
$parser = '';
while ($count < strlen($_GET['string'])){
    if(substr($string, $count, 1) == '_'){
        $parser = $parser . ' ';
    }
    else{
        $parser = $parser . (substr($string, $count, 1));
    }
    $count ++;
}

You do know there is a parse command in PHP.


http://i46.tinypic.com/dw7zft.png

Offline

 

#237 2011-07-22 17:37:35

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

SeptimusHeap wrote:

check the conversation

I just replied.

Last edited by SeptimusHeap (2011-07-22 17:38:06)


http://i46.tinypic.com/dw7zft.png

Offline

 

#238 2011-07-22 17:48:20

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

There's a parse command? *facepalm*


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#239 2011-07-22 18:06:05

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

http://www.blocks.scratchr.org/API.php?action=text&amp;string=spaces_are_accepted_now!

However, Scratch itself does not like spaces in img tags so you still have to type in the underscores  hmm

Last edited by sparks (2011-07-22 18:07:42)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#240 2011-07-22 18:17:58

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Check msgs


http://i46.tinypic.com/dw7zft.png

Offline

 

#241 2011-07-22 18:20:30

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

I'm glad I got the cogs working  big_smile


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#242 2011-07-22 18:26:16

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

SeptimusHeap wrote:

Check msgs

Did.

Yes, thanks Rum, I had no idea that parser function existed!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#243 2011-07-22 18:33:09

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

Well don't worry, I didn't know about the strrpos. Php is a wonderous language full of many different functions, you're only going to find out how and what they are by reading things or people telling you.


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#244 2011-07-22 18:36:31

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Yeah, it's amazing how many string functions there are!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#245 2011-07-22 18:52:43

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

my newest project is called http://blocks.scratchr.org/API.php?user=sparks&amp;action=projects&amp;type=newest&amp;return=text&amp;num=1. Click the name to go there!

take 1: :Hallelujah:hey%2
take 2: Hallelujah:
take 3: Hallelujah

testing with different name:

http://blocks.scratchr.org/API.php?user=sparks&amp;action=projects&amp;type=newest&amp;return=text&amp;num=2 (my second newest project)

YES! It works!

Code:

[img]http://blocks.scratchr.org/API.php?user=USERNAME&action=projects&type=newest&return=text&num=NUMBER[/img]

here's the new code snippet, also viewable in the second post:

Code:

if($_GET['return'] == 'text'){
                $project = substr($page, $placeholder, $endplaceholder - $placeholder);
                $page = ltrim(file_get_contents('http://scratch.mit.edu/api/getprojectinfobyid/' . $project));
                $text = strpos($page, ':', 1);
                $text ++;
                $text = substr($page, $text, strpos($page, ':', $text + 1) - 7);
                $text = str_replace("%20","_",$text);
                echo file_get_contents('http://www.blocks.scratchr.org/textrender.php?string=' . $text);
            }

Oh, note, there may be problems with projects with a : in the name...

Last edited by sparks (2011-07-22 19:10:43)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#246 2011-07-22 19:09:48

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

^ the page I draw the name from can also give me loveit, num_favoriters, remixer, remixes, numberOfSprites, totalScripts, numberofcomments and numberofdownloads!
Comments, downloads, loves and faves all being something people would want!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#247 2011-07-23 03:50:43

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

LiquidMetal wrote:

comp500, could you make your generator have an option for both image and link? So I can link to a separate place with the o/o separate images?

?


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#248 2011-07-23 04:14:38

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

comp500 wrote:

sparks wrote:

Alas, I have to go soon for a while  hmm  Back in a bit.

Ok. So do I.
Linktongue  and can u put that link on the main post?


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#249 2011-07-23 04:27:36

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

SeptimusHeap wrote:

sparks wrote:

Hmm, most people use sigs to talk about themselves, advertise something they've done, or advertise something a specific Scratcher has done that they liked. I think a few people might have a "unseen project of the day" sort of thing going but there isn't much call for it...

Hmm... Well, I could do random project or user, but, I guess...

IDEA!
If the project hasn't got many views, it is shown!

ANOTHER IDEA!
Adverts! What we need is a thing like this:

My generator requests ?action=returnAdSpotCode
Then it puts the code into the url so it looks like this: ?adSpotCode=AA000&action=returnAdImg
Which returns an image for the ad,
then the link for the ad is ?adSpotCode=AA000&action=returnAdLink
so when the user goes to ?adSpotCode=AA000&action=returnAdLink (clicks on the ad) it will take them to the page for the ad.

Because there is a code for the ad spot, the api will know which ad page to direct the user to

Last edited by comp500 (2011-07-23 04:30:35)


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#250 2011-07-23 05:21:39

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

But what would be in the adverts?


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

Board footer