egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Eggdrop HTTP Post

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
kenneal
Voice


Joined: 11 Mar 2007
Posts: 10

PostPosted: Sun Apr 29, 2007 2:31 pm    Post subject: Eggdrop HTTP Post Reply with quote

I've done a few website parsing scripts myself but I need help on the POST techniques.

This is the extracted form code

;;;;;;;;;;;;;;;;;;;;;;;;;;;started html code

<form method=POST onSubmit="openpage()" action=fetch.php enctype=multipart/form-data>
<table border=0 cellspacing=0 cellpadding=0 align=center>
<tr align=center>
<td align=center>
</td>
</tr>
<tr height=27 valign="bottom">
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td>
<font size=3 color=#ff6600>Enter your code</font>

<input type=text name=code size=30 value=OPwDA3NR2G >

</td>
<td valign="bottom">
<input type="submit" height=27 width=174 border=0 valign="bottom" value="Download">

;;;;;;;;;;;;;;;;;;;;;;;;end of html code

I am trying to make the eggdrop download the file automatically but first of all how can I go about POSTing to the fetch.php with the relevant input code "OPwDA3NR2G".
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Apr 29, 2007 3:51 pm    Post subject: Reply with quote

Look at any of half of the webscripts I've done, many of them use POST. The xe currency script, iplocator.tcl, earthcal, and a script I made for DimeaDozen.com to create accounts automagically.

The dime script might be the better example of grabbing a piece of the html form, for resubmitting back into the form, although that is a commandline script, not strictly speaking an eggdrop script.. Not hard to convert to eggdrop tho, just change puts to puthelp's for showing output, and such. You can find that one here:

http://members.dandy.net/~fbn/dime-signup.tcl.txt

Basically all you're doing is using regexp to grab whatever data you need to feed into the form, and then using http::formatQuery to stuff it back with http::geturl -query $querydata

From looking at your html, formatQuery would be: code "OPwDA3NR2G"
Back to top
View user's profile Send private message
kenneal
Voice


Joined: 11 Mar 2007
Posts: 10

PostPosted: Sun Apr 29, 2007 8:25 pm    Post subject: Reply with quote

Thanks, works like a gem Smile Cheerios! Razz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber