I need to know some things about this.
Is there a page to get the most recent project of a user, or the __th recent/oldest project?
Offline
PythonLibrary wrote:
There is no scratch.mit.edu/api (The link)
I know that.
But look at http://scratch.mit.edu/api/getproject/1588557
Offline
scimonster wrote:
PythonLibrary wrote:
There is no scratch.mit.edu/api (The link)
I know that.
But look at http://scratch.mit.edu/api/getproject/1588557
So here is how you did it (?) 1. You took those numbers in your project URL. 2. you changed the /users/scimonster to api/getproject/*numbers*. Is this how you did it?
Offline
PythonLibrary wrote:
scimonster wrote:
PythonLibrary wrote:
There is no scratch.mit.edu/api (The link)
I know that.
But look at http://scratch.mit.edu/api/getproject/1588557So here is how you did it (?) 1. You took those numbers in your project URL. 2. you changed the /users/scimonster to api/getproject/*numbers*. Is this how you did it?
That is the Scratch api part of the site.
Offline
scimonster wrote:
Is there a page to get the most recent project of a user, or the __th recent/oldest project?
I've wondered if there was a way to do this. It looks like if you type a project number at the end of the /api url, it'll bring up that numbered project. That's something I'll have to remember.
Offline
I like the getproject API. I found the 1337th project.
Offline
ihaveamac wrote:
I like the getproject API. I found the 1337th project.
![]()
And the 1,000,000th project!
Offline
Please, stop playing around here. I'm looking for an answer. Scratch Team maybe?
Offline
scimonster wrote:
Please, stop playing around here. I'm looking for an answer. Scratch Team maybe?
The API isn't officially supported by the Scratch Team -_- I think...
I was going to use this to detect the latest user for my windows 7 gadget -_-
Offline
ssss wrote:
scimonster wrote:
Please, stop playing around here. I'm looking for an answer. Scratch Team maybe?
The API isn't officially supported by the Scratch Team -_- I think...
I was going to use this to detect the latest user for my windows 7 gadget -_-
if it wasn't, then how would it be there?
Offline
veggieman001 wrote:
ssss wrote:
scimonster wrote:
Please, stop playing around here. I'm looking for an answer. Scratch Team maybe?
The API isn't officially supported by the Scratch Team -_- I think...
I was going to use this to detect the latest user for my windows 7 gadget -_-if it wasn't, then how would it be there?
Paddle2see wrote:
Hey ssss,
The API apparently doesn't have official documentation yet...and it's not really supported by the Scratch Team at this point either. But if you want to take a look at the source code, it is here
http://trac.assembla.com/scratchr/brows … roller.php
You also might want to talk to ask in the Advanced Topics area to see who has experience using it (maybe JSO?) to see if they can give you any pointers. Good luck!
Offline
ssss wrote:
veggieman001 wrote:
ssss wrote:
The API isn't officially supported by the Scratch Team -_- I think...
I was going to use this to detect the latest user for my windows 7 gadget -_-if it wasn't, then how would it be there?
Paddle2see wrote:
Hey ssss,
The API apparently doesn't have official documentation yet...and it's not really supported by the Scratch Team at this point either. But if you want to take a look at the source code, it is here
http://trac.assembla.com/scratchr/brows … roller.php
You also might want to talk to ask in the Advanced Topics area to see who has experience using it (maybe JSO?) to see if they can give you any pointers. Good luck!
What's the link to?
Offline
scimonster wrote:
ssss wrote:
veggieman001 wrote:
if it wasn't, then how would it be there?Paddle2see wrote:
Hey ssss,
The API apparently doesn't have official documentation yet...and it's not really supported by the Scratch Team at this point either. But if you want to take a look at the source code, it is here
http://trac.assembla.com/scratchr/brows … roller.php
You also might want to talk to ask in the Advanced Topics area to see who has experience using it (maybe JSO?) to see if they can give you any pointers. Good luck!What's the link to?
?
That should link to API code
Offline
ssss wrote:
scimonster wrote:
ssss wrote:
veggieman001 wrote:
if it wasn't, then how would it be there?
What's the link to?
?
That should link to API code
It's not valid.
Offline
scimonster wrote:
ssss wrote:
scimonster wrote:
What's the link to??
That should link to API codeIt's not valid.
Go find the post
Offline
scimonster wrote:
ssss wrote:
scimonster wrote:
What's the link to?
?
That should link to API codeIt's not valid.
Scratch abbreviates the URL when you use the URL tag, so that's not the complete link. Let me see if I can find the original link.
Edit: Found it.
Last edited by Harakou (2011-05-01 10:12:46)
Offline
Harakou wrote:
scimonster wrote:
ssss wrote:
?
That should link to API codeIt's not valid.
Scratch abbreviates the URL when you use the URL tag, so that's not the complete link. Let me see if I can find the original link.
Edit: Found it.
Thank you!
Offline
I needed my site to check the validity of a Scratch username and password and thought that people might like the php code.
$t1 = trim(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $_POST['scratchUsername'] . '&password=' . $_POST['scratchPassword'])); if($t1 == 'false'){ echo "The username or password you entered was incorrect!"; } else{ echo "Username and password correct!"; } }
Your POST names may of course differ and the echo message can be changed to anything but this works very neatly!
file_get_contents() is a php command I found that pulls the contents of an entire file into a variable string for your use.
trim() is a php command that trims whitespace if there is any surrounding your variable. I found that the result never returned as 'false' until I used ltrim as there must have been whitespace around it.
Last edited by sparks (2011-06-29 14:32:02)
Offline
sparks wrote:
I needed my site to check the validity of a Scratch username and password and thought that people might like the php code.
Code:
$t1 = ltrim(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $_POST['scratchUsername'] . '&password=' . $_POST['scratchPassword'])); if($t1 == 'false'){ echo "The username or password you entered was incorrect!"; } else{ echo "Username and password correct!"; } }Your POST names may of course differ and the echo message can be changed to anything but this works very neatly!
file_get_contents() is a php command I found that pulls the contents of an entire file into a variable string for your use.
ltrim() is a php command that trims whitespace if there is any surrounding your variable. I found that the result never returned as 'false' until I used ltrim as there must have been whitespace around it.
Isn't ltrim only for the first characters, and 'trim' for the first and last?
Offline
sparks wrote:
You're absolutely right! I looked up the method in a hurry! I shall change it
(It still works in this situation though).
Nice to see that you're learning PHP anyway! It took me a while before I got the motivation
Offline
I've known php for about two months now, but obviously knowing php means you understand the syntax and know enough of the commands to get by! As soon as something new comes along I have to look it up and learn that too!
Offline