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

#1 2012-02-18 13:04:59

ArtyArtArt679234
Scratcher
Registered: 2011-12-10
Posts: 22

Posting projects on other sites.

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)


http://i41.servimg.com/u/f41/17/21/15/63/barbar10.jpg/

Offline

 

#2 2012-02-18 13:06:23

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Posting projects on other sites.

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)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-02-18 13:13:18

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Posting projects on other sites.

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

 

#4 2012-02-18 13:21:55

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Posting projects on other sites.

By the way, I'm working on a PHP script to get this data. Give me, maybe, 5 more minutes.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#5 2012-02-18 13:24:07

ArtyArtArt679234
Scratcher
Registered: 2011-12-10
Posts: 22

Re: Posting projects on other sites.

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)


http://i41.servimg.com/u/f41/17/21/15/63/barbar10.jpg/

Offline

 

#6 2012-02-18 13:25:35

ArtyArtArt679234
Scratcher
Registered: 2011-12-10
Posts: 22

Re: Posting projects on other sites.

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.


http://i41.servimg.com/u/f41/17/21/15/63/barbar10.jpg/

Offline

 

#7 2012-02-18 13:32:13

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Posting projects on other sites.

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)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#8 2012-02-18 13:37:32

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Posting projects on other sites.

Do you have a web server that supports a language called PHP?


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#9 2012-02-18 13:40:40

ArtyArtArt679234
Scratcher
Registered: 2011-12-10
Posts: 22

Re: Posting projects on other sites.

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)


http://i41.servimg.com/u/f41/17/21/15/63/barbar10.jpg/

Offline

 

#10 2012-02-18 13:42:42

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Posting projects on other sites.

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];
?>

I support the Free Software Foundation. Protect our digital rights!

Offline

 

#11 2012-02-18 13:43:04

ArtyArtArt679234
Scratcher
Registered: 2011-12-10
Posts: 22

Re: Posting projects on other sites.

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.


http://i41.servimg.com/u/f41/17/21/15/63/barbar10.jpg/

Offline

 

#12 2012-02-18 13:44:43

ArtyArtArt679234
Scratcher
Registered: 2011-12-10
Posts: 22

Re: Posting projects on other sites.

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.


http://i41.servimg.com/u/f41/17/21/15/63/barbar10.jpg/

Offline

 

#13 2012-02-18 13:58:11

ArtyArtArt679234
Scratcher
Registered: 2011-12-10
Posts: 22

Re: Posting projects on other sites.

Can something be done with the project notes, too? If not I could just add the description.


http://i41.servimg.com/u/f41/17/21/15/63/barbar10.jpg/

Offline

 

#14 2012-02-19 13:02:31

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

Re: Posting projects on other sites.

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.


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

Offline

 

#15 2012-02-19 19:17:38

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Posting projects on other sites.

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

 

Board footer