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?
![]()
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.
Offline
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
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?
Offline
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
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:
FOREVER ( [post something] [wait 60 or 180 seconds] )

Offline
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.
Offline
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?

Offline
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.
Offline
So is there any squeak code to post with Panther?
Offline
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.
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:
<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
Offline
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
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.
Offline
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?
![]()
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?
Offline
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