Offline
majormax, this topic clearly has no meaning.
Does this have anything to do with Advanced Topics?
Offline
sparks wrote:
Peter, he could be testing a forum reader or writer for all you know
Let it be for now
![]()
Sorry For The Misunderstanding.
Well, good luck with your test, majormax
Offline
Offline
majormax wrote:
Thank you.
No Problem.
Offline
If it's a poster or reader in Scratch, I want to see this. ^.^
Offline
Are we ever going to get to see what this test is for?
They say hiding is the best form of advertising, and they're right
Offline
LS97 wrote:
Are we ever going to get to see what this test is for?
They say hiding is the best form of advertising, and they're right![]()
The SUSPENSE!
Offline
Time for the suspense to end.
I was trying to make a forum poster in panther, which would later evolve into and AI similar to cleverbot. This post was to test what happens when you press submit, and to later be a testing ground for the program. My current problem is getting panther to send $_Post requests.
Offline
majormax wrote:
Time for the suspense to end.
I was trying to make a forum poster in panther, which would later evolve into and AI similar to cleverbot. This post was to test what happens when you press submit, and to later be a testing ground for the program. My current problem is getting panther to send $_Post requests.
Ah, interesting prospective. If you don't mind, I would attempt it too. I'll be back with news, don't close the topic!
Offline
testing!
Offline
hear ye, hear ye!
The post above has been made from my computer. Unfortunately, you need to be logged in to the site to post. I'll do some more testing now.
Offline
Offline
This is very interesting! I'm very interested.
Offline
Offline
Post the blocks you made in the Block Library for others to use, I would really like to have those. ^.^
I suggest creating blocks like these:
[Send $_POST variable "var" with value "value" on next page load]
[Set $_COOKIE variable "var" with value "value"]
Blocks like those could allow the ability to make forum posters for any forum!
Offline
majormax wrote:
Time for the suspense to end.
I was trying to make a forum poster in panther, which would later evolve into and AI similar to cleverbot. This post was to test what happens when you press submit, and to later be a testing ground for the program. My current problem is getting panther to send $_Post requests.
Send it to a URL that has the form action set to the firm action in scratch, and on the URL page add jquery and put below it:
<script type="text/javascript">
$(document).ready(function(){
document.form.submit();
});
</script>and have php put default values in the form text areas using the get method and it should work
Offline
GP1 wrote:
majormax wrote:
Time for the suspense to end.
I was trying to make a forum poster in panther, which would later evolve into and AI similar to cleverbot. This post was to test what happens when you press submit, and to later be a testing ground for the program. My current problem is getting panther to send $_Post requests.Send it to a URL that has the form action set to the firm action in scratch, and on the URL page add jquery and put below it:
Code:
<script type="text/javascript"> $(document).ready(function(){ document.form.submit(); }); </script>and have php put default values in the form text areas using the get method and it should work
Your method opens a browser. My goal is to avoid that.
Offline
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...
<?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;
?>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 was thinking of doing something like this but couldn't figure out how.
I actually I'm going camping soon, so I don't have time to look over that. Good luck though!
Offline
Aww..
OK then, I'll make a topic to make it more visible.
Offline
I'll just report this to get a name change.
How about: Posting with Panther
Offline
ok sure
Offline
majormax, care to edit that first post? it certainly doesn't make the user want to scroll down to my code..
maybe a link to
http://scratch.mit.edu/forums/viewtopic.php?pid=855186#p855186
Offline