I know how to post projects on other sites using the Embed link, but is it possible to add the project notes, title, and love-it buttons too? I don't think you can, but if it is an ability someone at my programming level can handle, please let me know!
Last edited by ArtyArtArt679234 (2012-02-18 13:05:37)
Offline
It is, just let me check.
Look at this:
http://scratch.mit.edu/projects/expandDescription/PROJECTIDHERE/0
To find the project id:
http://scratch.mit.edu/projects/USERNAMEHERE/PROJECTIDHERE
You'll still have to parse it, though. Do you want me to do that?
Last edited by bobbybee (2012-02-18 13:10:00)
Offline
Also, for the love-it button, it's currently an AJAX request at http://projecturl/loveit that returns the text "I love it!" or "Love it?" (depending on the current state).
Offline
By the way, I'm working on a PHP script to get this data. Give me, maybe, 5 more minutes.
Offline
thnx & wut???????
translation:
> am i supposed to insert the given urls somewhere?
>wut does 'parse' mean?
>wut's a project ID?
>wut is PHP?
*Pleaase don't answer all these questions in random order on a single string. (Yes, Lemony Snicket HAS given me issues)
Last edited by ArtyArtArt679234 (2012-02-18 13:27:29)
Offline
bobbybee wrote:
By the way, I'm working on a PHP script to get this data. Give me, maybe, 5 more minutes.
Ehh??
WUT DOES THIS ALL MEAN??????
PS:thank you for responding.
Offline
ArtyArtArt679234 wrote:
thnx & wut???????
translation:
> am i supposed to insert the given urls somewhere?
not sure what you mean?
>wut does 'parse' mean?
interpret
>wut's a project ID?
scratch.mit.edu/projects/USERNAME/projectid
>wut is PHP?
PHP: Hypertext Preprocessor (a language for programming websites)
*Pleaase don't answer all these questions in random order on a single string. (Yes, Lemony Snicket HAS given me issues)
Offline
Do you have a web server that supports a language called PHP?
Offline
TRocket wrote:
ArtyArtArt679234 wrote:
thnx & wut???????
translation:
> am i supposed to insert the given urls somewhere?
not sure what you mean?
i'm not asking you! i'm asking someone else!
>wut does 'parse' mean?
interpret
>wut's a project ID?
scratch.mit.edu/projects/USERNAME/projectid
yes i know that's what one looks like! i meant what is it for?what does it do?
>wut is PHP?
PHP: Hypertext Preprocessor (a language for programming websites)
*Please don't answer all these questions in random order on a single string. (Yes, Lemony Snicket HAS given me issues)
Offline
Uh...can TRocket help you with the rest. I gotta leave.
TRocket, I've written a PHP script that has a variable for the project id and prints out some data. Can you assist ArtyArtArt679234 in installing and running it. Here is my script:
<?php $values = array(); $projectID = 2224068; $contents = file_get_contents("http://scratch.mit.edu/projects/expandDescription/".$projectID."/0"); $explosion = explode(":", $contents); $i = 0; foreach($explosion as $exploded){ $explo = strip_tags($exploded); if($i != 4){ $explo = explode("\n",$explo); $explo = $explo[0]; } if($i == 2){ $explo = explode("|",$explo); $explo = $explo[0]; } if($i == 3){ $explo = preg_replace('/[a-z](?=\d)|\d(?=[a-z])/i', '$0|', $explo); $explo = explode('|',$explo); $explo = str_replace("\n","<br/>",$explo[0]); } //$explo = $explo[0]; if($i != 0){ //echo $i.": ".$explo."\n"; $values[] = $explo; } ++$i; } echo "This project was created by ".$values[0].". It has ".$values[1]." views and ".$values[2]." love-its. This is it's project description.<br/><br/>".$values[3]; ?>
Offline
bobbybee wrote:
Do you have a web server that supports a language called PHP?
erm..i'm not sure if i even have a server. do you mean browser?if so, i'm using Safari.
Offline
bobbybee wrote:
Uh...can TRocket help you with the rest. I gotta leave.
TRocket, I've written a PHP script that has a variable for the project id and prints out some data. Can you assist ArtyArtArt679234 in installing and running it. Here is my script:Code:
<?php $values = array(); $projectID = 2224068; $contents = file_get_contents("http://scratch.mit.edu/projects/expandDescription/".$projectID."/0"); $explosion = explode(":", $contents); $i = 0; foreach($explosion as $exploded){ $explo = strip_tags($exploded); if($i != 4){ $explo = explode("\n",$explo); $explo = $explo[0]; } if($i == 2){ $explo = explode("|",$explo); $explo = $explo[0]; } if($i == 3){ $explo = preg_replace('/[a-z](?=\d)|\d(?=[a-z])/i', '$0|', $explo); $explo = explode('|',$explo); $explo = str_replace("\n","<br/>",$explo[0]); } //$explo = $explo[0]; if($i != 0){ //echo $i.": ".$explo."\n"; $values[] = $explo; } ++$i; } echo "This project was created by ".$values[0].". It has ".$values[1]." views and ".$values[2]." love-its. This is it's project description.<br/><br/>".$values[3]; ?>
thank u. bye.
Offline
Can something be done with the project notes, too? If not I could just add the description.
Offline
LS97 wrote:
Also, for the love-it button, it's currently an AJAX request at http://projecturl/loveit that returns the text "I love it!" or "Love it?" (depending on the current state).
I thought the xml:http request only works if it is on the same host as the script.
Offline
ArtyArtArt679234 wrote:
bobbybee wrote:
Do you have a web server that supports a language called PHP?
erm..i'm not sure if i even have a server. do you mean browser?if so, i'm using Safari.
The server is where you are hosting your website. Does it support PHP?
Offline