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

#151 2011-07-19 15:21:21

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

Re: My new online/offline API for the fora

online updated.


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

Offline

 

#152 2011-07-19 15:31:57

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

Re: My new online/offline API for the fora

here are some images (PNG) that are perfect (made by me): http://img228.imageshack.us/img228/7972/offlinetxt.png
http://img221.imageshack.us/img221/2933/onlinetxt.png


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

Offline

 

#153 2011-07-19 15:36:09

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

Re: My new online/offline API for the fora

http://img228.imageshack.us/img228/7972/offlinetxt.png http://blocks.scratchr.org/offlineText.png

http://img221.imageshack.us/img221/2933/onlinetxt.png http://blocks.scratchr.org/onlineText.png

Yours do look more like the ones in posts! Can I use them?

Last edited by sparks (2011-07-20 05:37:19)


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

Offline

 

#154 2011-07-19 15:37:18

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: My new online/offline API for the fora

They're not showing. (imageshack)

Offline

 

#155 2011-07-20 00:12:46

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: My new online/offline API for the fora

This is really cool! I wonder whether you could make a quick addition that simply returns text, even a 1 for online and a 0 otherwise. It wouldn't be very useful in the forums but I'm sure I could find...other...applications for it.  tongue

EDIT: What about an option to return a list of all online users?


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#156 2011-07-20 02:56:49

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

Re: My new online/offline API for the fora


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

Offline

 

#157 2011-07-20 03:09:23

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

Re: My new online/offline API for the fora

fullmoon wrote:

This is really cool! I wonder whether you could make a quick addition that simply returns text, even a 1 for online and a 0 otherwise. It wouldn't be very useful in the forums but I'm sure I could find...other...applications for it.  tongue

EDIT: What about an option to return a list of all online users?

I agree.  tongue

and what about a ver for the tbg!


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

Offline

 

#158 2011-07-20 05:09:45

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

Re: My new online/offline API for the fora

fullmoon wrote:

This is really cool! I wonder whether you could make a quick addition that simply returns text, even a 1 for online and a 0 otherwise. It wouldn't be very useful in the forums but I'm sure I could find...other...applications for it.  tongue

EDIT: What about an option to return a list of all online users?

Well the 1 and the 0 is certainly possible. Until I work out how to get php to create images of text on demand I'm afraid "all online users" or other values that aren't a small number of possible values won't be possible... I know that php creating images of text IS possible so I just need to research it and work out how to use it! I'll add a 1/0 addition to the API this morning though as that's no trouble. (they will be images mind, you can't use them for calculations).

Actually, the API could currently return a list of all online users, but in text format, not something the fora can display. Is that something you would like to use? You'd need to use php include() or HTML i-frame to make the results appear on a page.

comp500 wrote:

and what about a ver for the tbg!

That's a good point, I'd forgotten about that. I'm sure I can add a new parameter (providing the TBG have an index page or page where all online users are shown)

______________________________________________________________________-

oh, to people still posting here, there's a new API page here which is more advanced than the one documented on this thread!

Last edited by sparks (2011-07-20 05:11:10)


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

Offline

 

#159 2011-07-20 05:11:57

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: My new online/offline API for the fora

Yay!  Am adding this to the Rocket front page  smile

Can you make it so it shows if a user of one or another account is online?  Because I use both
SSSS and wulfmaster.  Do you think it could display if either is online, or both offline?


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#160 2011-07-20 05:12:15

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: My new online/offline API for the fora

sparks wrote:

comp500 wrote:

and what about a ver for the tbg!

That's a good point, I'd forgotten about that. I'm sure I can add a new parameter (providing the TBG have an index page or page where all online users are shown)

scratch.mit.edu/tbgforums
;P

Offline

 

#161 2011-07-20 05:40:05

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

Re: My new online/offline API for the fora

ssss wrote:

Yay!  Am adding this to the Rocket front page  smile

Can you make it so it shows if a user of one or another account is online?  Because I use both
SSSS and wulfmaster.  Do you think it could display if either is online, or both offline?

... Yes, I suppose that's possible. It seems like most people wouldn't have a need for that though, you could always just have two instances of the image link in your sig. I'm slightly aware that the more parameters I add to an action attribute, that more confusing the documentation becomes to read  hmm


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

Offline

 

#162 2011-07-20 05:43:16

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

Re: My new online/offline API for the fora

Today's to-do-list:

Create a second parameter that allows all current API action parameters to apply to only tbg or both tbg and main forum. Parameter is left blank for main forum.

Create a 1 or 0 option for online/offline status return.

Look into text-as-images to allow text return for project names and "all online users" return.

Watch  that new CSI: Las Vegas episode that was on last night.

Last edited by sparks (2011-07-20 05:43:59)


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

Offline

 

#163 2011-07-20 05:45:15

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: My new online/offline API for the fora

sparks wrote:

ssss wrote:

Yay!  Am adding this to the Rocket front page  smile

Can you make it so it shows if a user of one or another account is online?  Because I use both
SSSS and wulfmaster.  Do you think it could display if either is online, or both offline?

... Yes, I suppose that's possible. It seems like most people wouldn't have a need for that though, you could always just have two instances of the image link in your sig. I'm slightly aware that the more parameters I add to an action attribute, that more confusing the documentation becomes to read  hmm

Could you make it a seperate thing?  Instead of the main thing, it is a side plugin or something like it?  Or give me the code, so i can put it up on  my site  smile


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#164 2011-07-20 06:08:49

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

Re: My new online/offline API for the fora

Alright, watch this space... Do you want the circle, the square, the custom images or some or all of the above?

Last edited by sparks (2011-07-20 06:09:17)


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

Offline

 

#165 2011-07-20 06:12:13

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: My new online/offline API for the fora

Is there a way to do this with IPs? I wouldn't be able to, because I don't want to give out my IP and don't have a site to host the PHP on...
Why are you using blocks.scratchr.org for this anyways?

Offline

 

#166 2011-07-20 06:22:44

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

Re: My new online/offline API for the fora

Because if the images are hosted on a Scratch related site, images are less likely to be blocked, and because it's too late to change it  tongue

I don't think there's any reason for IP based online/offline status because we already have the Scratch one and if I start storing IP's in a table or even reading them I'll have to release a privacy policy for the API and it's just so much bother  tongue


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

Offline

 

#167 2011-07-20 06:25:06

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: My new online/offline API for the fora

sparks wrote:

Alright, watch this space... Do you want the circle, the square, the custom images or some or all of the above?

circle.


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#168 2011-07-20 06:32:29

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: My new online/offline API for the fora

sparks wrote:

Because if the images are hosted on a Scratch related site, images are less likely to be blocked, and because it's too late to change it  tongue

I don't think there's any reason for IP based online/offline status because we already have the Scratch one and if I start storing IP's in a table or even reading them I'll have to release a privacy policy for the API and it's just so much bother  tongue

Well, I guess I actually wanted it to display my online banner if either me or sci_test is online.  tongue
And I would also want to have it privately, so that people couldn't see my IP.  wink

Offline

 

#169 2011-07-20 06:42:06

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

Re: My new online/offline API for the fora

sparks is http://blocks.scratchr.org/API.php?action=onlineStatus&user=sparks&type=text on the main fora, http://blocks.scratchr.org/API.php?action=onlineStatus&user=sparks&type=text&target=tbg on the tbg fora and http://blocks.scratchr.org/API.php?action=onlineStatus&user=sparks&type=text&target=all in general across all fora.

The new parameter "target" can be left blank to search the main fora, set to "tbg" to search the tbg fora or set to "all" to search both.
I think that the new target parameters are working... It marks me as online on the tbg forum even though I've closed the window so that might just be an odd use of session variables because "noone" is not online there...

Last edited by sparks (2011-07-20 06:50:23)


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

Offline

 

#170 2011-07-20 06:52:21

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: My new online/offline API for the fora

sparks wrote:

sparks is http://blocks.scratchr.org/API.php?acti … ;type=text on the main fora, http://blocks.scratchr.org/API.php?acti … target=tbg on the tbg fora and http://blocks.scratchr.org/API.php?acti … target=all in general across all fora.

The new parameter "target" can be left blank to search the main fora, set to "tbg" to search the tbg fora or set to "all" to search both.
I think that the new target parameters are working... It marks me as online on the tbg forum even though I've closed the window so that might just be an odd use of session variables because "noone" is not online there...

Let me try...
http://blocks.scratchr.org/API.php?action=onlineStatus&user=scimonster&type=text
http://blocks.scratchr.org/API.php?action=onlineStatus&user=scimonster&type=text&target=tbg
http://blocks.scratchr.org/API.php?action=onlineStatus&user=scimonster&type=text&target=all
EDIT: Says I'm online when I am.
But still says online for TBG even though I'm not.  hmm

Last edited by scimonster (2011-07-20 06:56:28)

Offline

 

#171 2011-07-20 07:01:37

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

Re: My new online/offline API for the fora

That's what happened to me, which is odd... Try logging out of here and logging into TBG and see what it says then....

EDIT: I've nearly finished that special API that returns "online" if one of several users is online.

Last edited by sparks (2011-07-20 07:02:46)


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

Offline

 

#172 2011-07-20 07:02:57

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: My new online/offline API for the fora

OK, tell me what it says at 07:03 Scratch time.

Offline

 

#173 2011-07-20 07:03:57

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

Re: My new online/offline API for the fora

scimonster wrote:

sparks wrote:

Because if the images are hosted on a Scratch related site, images are less likely to be blocked, and because it's too late to change it  tongue

I don't think there's any reason for IP based online/offline status because we already have the Scratch one and if I start storing IP's in a table or even reading them I'll have to release a privacy policy for the API and it's just so much bother  tongue

Well, I guess I actually wanted it to display my online banner if either me or sci_test is online.  tongue
And I would also want to have it privately, so that people couldn't see my IP.  wink

You think it's worth adding the parameter to the main API? It wouldn't be hard...


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

Offline

 

#174 2011-07-20 07:05:21

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

Re: My new online/offline API for the fora

scimonster wrote:

OK, tell me what it says at 07:03 Scratch time.

I missed it. You should be able to view the forums as offline yourself though.


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

Offline

 

#175 2011-07-20 07:12:20

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

Re: My new online/offline API for the fora

if "online" then sparks, scimonster, MathWizz or Pecola1 are  online: http://blocks.scratchr.org/API.php?action=onlineStatus&user=sparks&user2=Scimonster&user3=MathWizz&user4=Pecola1.

if "online" then either fake1, fake2, fake3 or fake4 are online: http://blocks.scratchr.org/API.php?action=onlineStatus&user=fake1&user2=fake2&user3=fake3&user4=fake4

Up to four users can be checked with the existing API now. Simply add the parameters user 2-4 into the URL. all four do not have to be used, the first user is still called user, not user1.

Code:

[img]http://blocks.scratchr.org/API.php?action=onlineStatus&user=USERNAME1HERE&user2=USERNAME2HERE&user3=USERNAME3HERE&user4=USERNAME4HERE[/img]

Last edited by sparks (2011-07-20 07:19:13)


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

Offline

 

Board footer