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

#26 2011-07-31 09:08:27

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Posting with Panther

LS97 wrote:

I figured out some code to log into the site and post, but somewhere in there it all goes wrong. A PHP-knowledgeable person could maybe kindly help me on this issue?  smile

Here is my code...

Code:

<?php
    // first log into server
    $ckfile = tempnam("/tmp", "CURLCOOKIE");

    // create connection
    $curl_connection = curl_init('http://scratch.mit.edu/login');
    
    //set connection options
    curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
    curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl_connection, CURLOPT_COOKIEJAR, $ckfile);
    
    // set post values
    $post_data['User'] = $_GET['user'];
    $post_data['Pass'] = $_GET['pass'];
    $post_data['refer'] = $_GET['/'];

    // join values
    foreach ( $post_data as $key => $value) {
        $post_items[] = $key . '=' . $value;
    }
    $post_string = implode ('&', $post_items);
    curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
    
    // send post and close connection
    $firstres = curl_exec($curl_connection);
    curl_close($curl_connection);

    ############################################################
    // create connection
    $curl_connection = curl_init('http://scratch.mit.edu/forums/post.php?action=post&tid=70082');
    
    //set connection options
    curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
    curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl_connection, CURLOPT_COOKIEFILE, $ckfile);
    
    // set post values
    $post_data['form_sent'] = '1';
    $post_data['form_user'] = $_GET['user'];
    $post_data['req_message'] = $_GET['message'];

    // join values
    foreach ( $post_data as $key => $value) {
        $post_items[] = $key . '=' . $value;
    }
    $post_string = implode ('&', $post_items);
    curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
    
    // send post and close connection
    $result = curl_exec($curl_connection);
    curl_close($curl_connection);
    
    #echo $result;

?>

I don't have time to look at the code properly but one thing to check is whether you have curl and the curl lib for php installed on the server computer hosting it.


http://i.imgur.com/zeIZW.png

Offline

 

#27 2011-07-31 16:57:14

TornFusion
Scratcher
Registered: 2010-09-03
Posts: 1000+

Re: Posting with Panther

And the evolution of spam comes to scratch. The project has turned.

This device is powerful. It literally has the power to SPAM scratch if you added a wait 60 seconds rule.

Offline

 

#28 2011-07-31 16:59:14

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Posting with Panther

TornFusion wrote:

And the evolution of spam comes to scratch. The project has turned.

This device is powerful. It literally has the power to SPAM scratch if you added a wait 60 seconds rule.

what's this got to do with anything?


http://i.imgur.com/zeIZW.png

Offline

 

#29 2011-07-31 17:04:05

TornFusion
Scratcher
Registered: 2010-09-03
Posts: 1000+

Re: Posting with Panther

rookwood101 wrote:

TornFusion wrote:

And the evolution of spam comes to scratch. The project has turned.

This device is powerful. It literally has the power to SPAM scratch if you added a wait 60 seconds rule.

what's this got to do with anything?

Lets see.

Project that can post all by itself. <-------
^ ^ ^
| | |
| | |

Offline

 

#30 2011-07-31 23:49:37

Sidharth
Scratcher
Registered: 2007-12-14
Posts: 100+

Re: Posting with Panther

rookwood101 wrote:

TornFusion wrote:

And the evolution of spam comes to scratch. The project has turned.

This device is powerful. It literally has the power to SPAM scratch if you added a wait 60 seconds rule.

what's this got to do with anything?

What he means is that you can make a script:

Code:

FOREVER (
[post something]
[wait 60 or 180 seconds]
)

http://www.danasoft.com/citysign.jpg

Offline

 

#31 2011-08-01 04:15:53

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Posting with Panther

Sidharth wrote:

rookwood101 wrote:

TornFusion wrote:

And the evolution of spam comes to scratch. The project has turned.

This device is powerful. It literally has the power to SPAM scratch if you added a wait 60 seconds rule.

what's this got to do with anything?

What he means is that you can make a script:

Code:

FOREVER (
[post something]
[wait 60 or 180 seconds]
)

Ahh I see.


http://i.imgur.com/zeIZW.png

Offline

 

#32 2011-08-01 04:28:04

Sidharth
Scratcher
Registered: 2007-12-14
Posts: 100+

Re: Posting with Panther

TornFusion wrote:

And the evolution of spam comes to scratch. The project has turned.

This device is powerful. It literally has the power to SPAM scratch if you added a wait 60 seconds rule.

But seriously. Would a spammer go so far and actually get this Panther block to spam the forums? Is that really worth the effort? Why not leave this forum and go spam some easier-to-spam place?


http://www.danasoft.com/citysign.jpg

Offline

 

#33 2011-08-06 14:28:21

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: Posting with Panther

Sidharth wrote:

TornFusion wrote:

And the evolution of spam comes to scratch. The project has turned.

This device is powerful. It literally has the power to SPAM scratch if you added a wait 60 seconds rule.

But seriously. Would a spammer go so far and actually get this Panther block to spam the forums? Is that really worth the effort? Why not leave this forum and go spam some easier-to-spam place?

This makes it the easiest.


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#34 2011-08-06 16:02:15

cskidmsonic
Scratcher
Registered: 2011-01-22
Posts: 100+

Re: Posting with Panther

So is there any squeak code to post with Panther?


This signature is TDD's fault... yes, I had to.

Offline

 

#35 2011-08-06 16:05:56

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Posting with Panther

On a similar topic, I think someone should make a "tag the %nth project with %s' block.  I couldn't understand the source of the project website, so I tried something, and it completely failed.   sad

EDIT: Here's what I know:  when you press the button, it sends to a website which is equal to that of the project with '/tag' at the end.  But, as stupid as it sounds, I can't figure out how to send the text data.

EDIT 2:  This seems to be the tag that does it:

Code:

   <form id='tag' action="/projects/Greenatic/1884743/tag" method="post" onSubmit="this.tag_textarea.value='';">

Is there anyone who can decipher that for me?  The only Internet-related command I know in Squeak is "ScratchPlugin primOpenURL:" which opens a webpage or file at a given filepath/address.  Can anyone tell me what I need to append to .../Greenatic/1884743 ?

Last edited by Greenatic (2011-08-06 16:15:27)

Offline

 

#36 2011-08-06 16:15:43

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Posting with Panther

Maybe we could defeat the 60 second rule with this!

Offline

 

#37 2011-08-06 16:16:15

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

Re: Posting with Panther

ImagineIt wrote:

Maybe we could defeat the 60 second rule with this!

No, it's server side, so it will still be in effect.

Offline

 

#38 2011-08-06 16:20:56

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Posting with Panther

majormax wrote:

ImagineIt wrote:

Maybe we could defeat the 60 second rule with this!

No, it's server side, so it will still be in effect.

Aww. sad

Offline

 

#39 2011-08-06 23:27:18

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Posting with Panther

LS97 wrote:

I figured out some code to log into the site and post, but somewhere in there it all goes wrong. A PHP-knowledgeable person could maybe kindly help me on this issue?  smile

Here is my code...

Code:

<?php
    // first log into server
    $ckfile = tempnam("/tmp", "CURLCOOKIE");

    // create connection
    $curl_connection = curl_init('http://scratch.mit.edu/login');
    
    //set connection options
    curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
    curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl_connection, CURLOPT_COOKIEJAR, $ckfile);
    
    // set post values
    $post_data['User'] = $_GET['user'];
    $post_data['Pass'] = $_GET['pass'];
    $post_data['refer'] = $_GET['/'];

    // join values
    foreach ( $post_data as $key => $value) {
        $post_items[] = $key . '=' . $value;
    }
    $post_string = implode ('&', $post_items);
    curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
    
    // send post and close connection
    $firstres = curl_exec($curl_connection);
    curl_close($curl_connection);

    ############################################################
    // create connection
    $curl_connection = curl_init('http://scratch.mit.edu/forums/post.php?action=post&tid=70082');
    
    //set connection options
    curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
    curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl_connection, CURLOPT_COOKIEFILE, $ckfile);
    
    // set post values
    $post_data['form_sent'] = '1';
    $post_data['form_user'] = $_GET['user'];
    $post_data['req_message'] = $_GET['message'];

    // join values
    foreach ( $post_data as $key => $value) {
        $post_items[] = $key . '=' . $value;
    }
    $post_string = implode ('&', $post_items);
    curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
    
    // send post and close connection
    $result = curl_exec($curl_connection);
    curl_close($curl_connection);
    
    #echo $result;

?>

I dont know what the problem is. Have you tested the login script. Your method uses cookies. A browser only caches cookies. It also puts there that "this cookie was sent from this URL:" so you can't set a cookie to get it from scratch.
Also, could you explain how you got the auto uploads on modshare from a mod for my mods new site?


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#40 2011-08-11 13:56:42

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Posting with Panther

bump

Offline

 

#41 2011-08-11 16:16:49

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

Re: Posting with Panther

GP1 wrote:

I dont know what the problem is. Have you tested the login script. Your method uses cookies. A browser only caches cookies. It also puts there that "this cookie was sent from this URL:" so you can't set a cookie to get it from scratch.
Also, could you explain how you got the auto uploads on modshare from a mod for my mods new site?

No, I used a cookie jar to save the login cookies for that purpose.

Offline

 

Board footer