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

#1 2012-09-09 13:39:11

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Scratch APIs?

What/where are the APIs for Scratch?


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#2 2012-09-09 13:47:31

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Scratch APIs?

The only API I know of is the one to authenticate users, which is:

Code:

http://scratch.mit.edu/api/authenticateuser?username=jvvg&password=[I'm not saying my password]

http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#3 2012-09-09 13:53:38

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Scratch APIs?

Actually, looking at the source code, I found some other ones, such as...

Code:

http://scratch.mit.edu/api/getgalleryinfobyid/24994 - gets info for a gallery by the ID given
http://scratch.mit.edu/api/getnumprojectsbyuser/jvvg - gets the number of projects uploaded by the given user
http://scratch.mit.edu/api/getnumcommentsbyuser/jvvg- gets the number of comments by the given user
http://scratch.mit.edu/api/getpcommentsbyid/255443 - returns all comments on the given project
http://scratch.mit.edu/api/getusersfavoriteprojectsbyuid/261892 - returns all favorited projects by the given user
http://scratch.mit.edu/api/getprojectblockscount/4447 - returns the amount of blocks in the given project
http://scratch.mit.edu/api/getprojectblocks/1308192 - returns JSON formatted code for the given project
http://scratch.mit.edu/api/get_latest_project/XXXXXXXXXXXXX - returns the latest project of the given user (enter an ID there) in JSON format
http://scratch.mit.edu/api/getblockcountpercategorybyuserid/139 - returns the amount of blocks by the given user by category in JSON format
http://scratch.mit.edu/api/getblockcategorycountbypid/12339 - returns the amount of blocks in the given project by category in JSON format
http://scratch.mit.edu/api/get_remixed_project - returns latest remixes in JSON format
http://scratch.mit.edu/api/getuserspcommentsbyuid/2/3  - returns all comments user A has posted on user B's projects (user ID, not username)

http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#4 2012-09-09 14:42:55

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: Scratch APIs?

someone could make some awesome stuff with those API's!!!


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#5 2012-09-09 16:23:53

DarthPickley
Scratcher
Registered: 2008-06-13
Posts: 100+

Re: Scratch APIs?

btw, API source code is at

http://trac.assembla.com/scratchr/brows … roller.php

Last edited by DarthPickley (2012-09-09 16:24:10)

Offline

 

#6 2012-09-09 16:41:51

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Scratch APIs?

DarthPickley wrote:

btw, API source code is at

http://trac.assembla.com/scratchr/brows … roller.php

Yeah, that's where I got the code (I have my own copy of ScratchR working).


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#7 2012-11-16 11:54:01

Asraelite
Scratcher
Registered: 2012-04-09
Posts: 100+

Re: Scratch APIs?

Does anyone have the API to get a user's id by their name? I really need it.


I hate the new vector graphics  sad

Offline

 

#8 2012-11-16 12:19:27

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: Scratch APIs?

Asraelite wrote:

Does anyone have the API to get a user's id by their name? I really need it.

Yes, here's the PHP code:

Code:

$getuserid = file_get_contents("http://scratch.mit.edu/api/getinfobyusername/" . $username);
$getuserid = explode(":", $getuserid);
$getuserid = $getuserid[1];

Set $username to the username, run this script, and then $getuserid will contain the ID.  smile

Offline

 

#9 2012-11-16 13:11:41

Asraelite
Scratcher
Registered: 2012-04-09
Posts: 100+

Re: Scratch APIs?

Gravitation wrote:

Asraelite wrote:

Does anyone have the API to get a user's id by their name? I really need it.

Yes, here's the PHP code:

Code:

$getuserid = file_get_contents("http://scratch.mit.edu/api/getinfobyusername/" . $username);
$getuserid = explode(":", $getuserid);
$getuserid = $getuserid[1];

Set $username to the username, run this script, and then $getuserid will contain the ID.  smile

Thanks a bunch  smile


I hate the new vector graphics  sad

Offline

 

#10 2012-11-16 13:12:32

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: Scratch APIs?

Asraelite wrote:

Gravitation wrote:

Asraelite wrote:

Does anyone have the API to get a user's id by their name? I really need it.

Yes, here's the PHP code:

Code:

$getuserid = file_get_contents("http://scratch.mit.edu/api/getinfobyusername/" . $username);
$getuserid = explode(":", $getuserid);
$getuserid = $getuserid[1];

Set $username to the username, run this script, and then $getuserid will contain the ID.  smile

Thanks a bunch  smile

No problem!  big_smile

Offline

 

#11 2012-11-16 15:54:52

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: Scratch APIs?

Couldn't someone easily write a bruteforcer with the API?

Offline

 

#12 2012-11-16 16:17:27

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Scratch APIs?

majormax wrote:

Couldn't someone easily write a bruteforcer with the API?

theoretically, which is why they're moving away from this and towards cas i believe


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#13 2012-11-16 16:20:27

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: Scratch APIs?

SJRCS_011 wrote:

which is why they're moving away from this and towards cas

Do you mean Central Authentication Service?

Offline

 

#14 2012-11-16 17:46:41

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: Scratch APIs?

s_federici wrote:

SJRCS_011 wrote:

which is why they're moving away from this and towards cas

Do you mean Central Authentication Service?

Yep, I think so.


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#15 2012-11-16 21:28:01

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Scratch APIs?

majormax wrote:

Couldn't someone easily write a bruteforcer with the API?

The API delays a long time if the username/password pair is incorrect. For example: http://scratch.mit.edu/api/authenticate … mypassword


nXIII

Offline

 

#16 2012-11-16 21:46:27

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Scratch APIs?

jvvg wrote:

Actually, looking at the source code, I found some other ones, such as...
-snip-

Hey, that's nice to know  big_smile

Dominic1 wrote:

someone could make some awesome stuff with those API's!!!

I'm pretty sure I've seen some Scratch mods (Panther?) that call these APIs.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#17 2012-11-16 21:54:55

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Scratch APIs?

technoguyx wrote:

jvvg wrote:

Actually, looking at the source code, I found some other ones, such as...
-snip-

Hey, that's nice to know  big_smile

Dominic1 wrote:

someone could make some awesome stuff with those API's!!!

I'm pretty sure I've seen some Scratch mods (Panther?) that call these APIs.

Mod Share does.  smile


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#18 2012-11-16 22:19:38

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Scratch APIs?

nXIII wrote:

majormax wrote:

Couldn't someone easily write a bruteforcer with the API?

The API delays a long time if the username/password pair is incorrect. For example: http://scratch.mit.edu/api/authenticate … mypassword

That's good.

And although 2.0 does have CAS, an API will be provided as well.


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#19 2012-11-17 17:56:53

Asraelite
Scratcher
Registered: 2012-04-09
Posts: 100+

Re: Scratch APIs?

majormax wrote:

Couldn't someone easily write a bruteforcer with the API?

Yup, I actually have to see if it would work. It does, but it is extremely slow and brute forcing would take months. I doubt someone would spend that much time on a Scratch account rather than a bank account or something.


I hate the new vector graphics  sad

Offline

 

#20 2012-11-17 20:17:22

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch APIs?

jji7skyline wrote:

nXIII wrote:

majormax wrote:

Couldn't someone easily write a bruteforcer with the API?

The API delays a long time if the username/password pair is incorrect. For example: http://scratch.mit.edu/api/authenticate … mypassword

That's good.

And although 2.0 does have CAS, an API will be provided as well.

https://docs.google.com/document/d/1sx3 … -0ktY/edit


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#21 2012-11-17 20:45:49

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Scratch APIs?


nXIII

Offline

 

#22 2012-11-17 22:31:29

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch APIs?

Oh yeah;

"Courtesy nXIII"

Happy?  tongue


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#23 2012-11-18 04:36:11

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

Re: Scratch APIs?

Yeah, the API's are cool. I used a lot of them to write the Scratch Forum API, better known as "self updating images and links in text"! I did write a brute force program for it once to generate a list of people who have friended me, since I can only see those that I have friended, but the process is so slow over the API I think I gave up when I realized it would take about ten days to check through all the names.

EDIT: found the old thread!  tongue

Last edited by sparks (2012-11-18 04:42:14)


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

Offline

 

#24 2012-11-18 04:58:01

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch APIs?

sparks wrote:

Yeah, the API's are cool. I used a lot of them to write the Scratch Forum API, better known as "self updating images and links in text"! I did write a brute force program for it once to generate a list of people who have friended me, since I can only see those that I have friended, but the process is so slow over the API I think I gave up when I realized it would take about ten days to check through all the names.

EDIT: found the old thread!  tongue

I think it was actually 10 months, if I remember right.  tongue

EDIT: Well, I remembered wrong.  tongue

Last edited by Hardmath123 (2012-11-18 04:58:26)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#25 2012-11-18 11:27:21

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Scratch APIs?

sparks wrote:

Yeah, the API's are cool. I used a lot of them to write the Scratch Forum API, better known as "self updating images and links in text"! I did write a brute force program for it once to generate a list of people who have friended me, since I can only see those that I have friended, but the process is so slow over the API I think I gave up when I realized it would take about ten days to check through all the names.

EDIT: found the old thread!  tongue

This used to work for friend names, but the 2.0 site APIs are dying and are going to be removed eventually…


nXIII

Offline

 

Board footer