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

#1 2011-07-29 11:26:14

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

Posting with Panther

I have a plan
(Ignore this post)

Offline

 

#2 2011-07-29 11:29:38

peterkap
Scratcher
Registered: 2009-01-24
Posts: 1000+

Re: Posting with Panther

majormax, this topic clearly has no meaning.
Does this have anything to do with Advanced Topics?

Offline

 

#3 2011-07-29 11:30:58

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Posting with Panther

Peter, he could be testing a forum reader or writer for all you know  tongue  Let it be for now  smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#4 2011-07-29 11:34:38

peterkap
Scratcher
Registered: 2009-01-24
Posts: 1000+

Re: Posting with Panther

sparks wrote:

Peter, he could be testing a forum reader or writer for all you know  tongue  Let it be for now  smile

Sorry For The Misunderstanding.
Well, good luck with your test, majormax  tongue

Offline

 

#5 2011-07-29 11:39:17

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

Re: Posting with Panther

Thank you.

Offline

 

#6 2011-07-29 11:45:29

peterkap
Scratcher
Registered: 2009-01-24
Posts: 1000+

Re: Posting with Panther

majormax wrote:

Thank you.

No Problem.

Offline

 

#7 2011-07-29 17:49:29

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Posting with Panther

If it's a poster or reader in Scratch, I want to see this. ^.^

Offline

 

#8 2011-07-30 06:42:35

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

Re: Posting with Panther

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  tongue

Offline

 

#9 2011-07-30 09:16:52

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

Re: Posting with Panther

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  tongue

The SUSPENSE!  big_smile

Offline

 

#10 2011-07-30 09:34:05

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

Re: Posting with Panther

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

 

#11 2011-07-30 09:43:10

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

Re: Posting with Panther

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!  smile

Offline

 

#12 2011-07-30 09:50:56

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

Offline

 

#13 2011-07-30 09:52:04

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

Re: Posting with Panther

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

 

#14 2011-07-30 09:52:24

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

Re: Posting with Panther

Cool!

Offline

 

#15 2011-07-30 09:54:47

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

Re: Posting with Panther

This is very interesting! I'm very interested.  big_smile

Offline

 

#16 2011-07-30 10:02:08

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

Offline

 

#17 2011-07-30 11:39:45

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Posting with Panther

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!  big_smile

Offline

 

#18 2011-07-30 11:57:38

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

Re: Posting with Panther

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


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

 

#19 2011-07-30 12:03:00

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

Re: Posting with Panther

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

 

#20 2011-07-30 12:26:39

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

Re: Posting with Panther

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;

?>

Offline

 

#21 2011-07-30 13:36:26

majormax
Scratcher
Registered: 2008-04-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 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!  smile

Offline

 

#22 2011-07-30 13:38:58

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

Re: Posting with Panther

Aww..
OK then, I'll make a topic to make it more visible.

Offline

 

#23 2011-07-30 13:58:30

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

Re: Posting with Panther

I'll just report this to get a name change.
How about: Posting with Panther

Offline

 

#24 2011-07-30 14:02:45

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

Offline

 

#25 2011-07-31 08:14:57

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

Re: Posting with Panther

majormax, care to edit that first post? it certainly doesn't make the user want to scroll down to my code..  tongue  maybe a link to
http://scratch.mit.edu/forums/viewtopic.php?pid=855186#p855186  tongue

Offline

 

Board footer