GtaSpider Posted May 9, 2008 Posted May 9, 2008 (edited) Hello everyone You all know the function on Inet.au3 "_INetGetSource". The bad is: It's need a dll and you can not send a Post string (execpt u send manually a header)So ive created a function (_InetGetSourcePost, very creative, like i am ) with witch u can Download the Sourcecode with Post sending.Youll receive the BackHeader and the Sourcecode in an Array.Ok, sorry for my bad english, but i hope u like my "autoish" Function:expandcollapse popup#include-once ;=============================================================================== ; ; Function Name: _INetGetSourcePost() ; Description: Gets the source from an URL without writing a temp file and you can send a Post. ; Parameter(s): $sURL = The URL of the site. ; $sPost = The Post to send ; Requirement(s): - ; Return Value(s): On Success - Return a array with $aReturn[0] = Backheader and $aReturn[1] = Sourcecode ; On Failure - 0 and sets @ERROR ; @error = 1: Post or URL is nothing ; @error = 2: Error by RegularExpression ; @error = 3: $sHost or $sHttp1 is nothing ; @error = 4: Can not get IP of Host ; @error = 5: Can not connect to host ; @error = 6: Nothing can be send ; @error = 7: Connection abborted while receiving ; Author(s): GtaSpider ; ;=============================================================================== Func _INetGetSourcePost($sURL, $sPost) Local $iSocket, $sHeader, $sRecv, $iIP, $sHost, $aRegExp, $sHttp1,$iErr,$iSend,$aReturn[2] If $sURL = '' Or $sPost = '' Then Return SetError(1, 0, 0) If StringLeft($sURL, 7) <> 'http://' And StringLeft($sURL, 8) <> 'https://' Then $sURL = "http://" & $sURL If StringRight($sURL, 1) <> "/" Then $sURL &= "/" $aRegExp = StringRegExp($sURL, "http?://(.*?)/", 3) If @error Then Return SetError(2, 0, 0) $sHost = $aRegExp[0] If $sHost = '' Then Return SetError(3, 0, 0) $sHttp1 = StringTrimLeft($sURL,StringInStr($sURL,"/",-1,3)-1) If $sHttp1 = '' Then Return SetError(3, 0, 0) $sHeader = "POST " & $sHttp1 & " HTTP/1.1" & @CRLF & _ "Host: " & $sHost & @CRLF & _ "User-Agent: AutoIt v3" & @CRLF & _ "Content-Length: " & StringLen($sPost) & @CRLF & @CRLF & $sPost TCPStartup() ;If not already done $iIP = TCPNameToIP($sHost) If $iIP = '' Or StringInStr($iIP, ".") = 0 Then Return SetError(4, 0, 0) $iSocket = TCPConnect($iIP, 80) If @error Or $iSocket < 0 Then Return SetError(5, 0, 0) $iSend = TCPSend($iSocket, $sHeader) If @error Or $iSend < 1 Then Return SetError(6, 0, 0) While 1 $sRecv = TCPRecv($iSocket, 1024) $iErr = @error If $sRecv <> '' Then While 1 $sRecv &= TCPRecv($iSocket, 1024) If @error Then ExitLoop 2 WEnd EndIf If $iErr Then Return SetError(7,0,0) WEnd $aReturn[0] = StringLeft($sRecv,StringInStr($sRecv,@CRLF&@CRLF)-1) $aReturn[1] = StringTrimLeft($sRecv,StringLen($aReturn[0])+4) Return $aReturn EndFunc ;==>_INetGetSourcePostoÝ÷ ØLZ^jëh×6#include <INETv2.au3> ;by GtaSpider SplashTextOn("","Downloading...",200,20,-1,-1,1) $aSource = _INetGetSourcePost("http://rs255.rapidshare.com/files/110695594/cardr.rar","dl.start=Free") If @error Then Exit MsgBox(16,"","Error: "&@error) FileWrite("TestFile.html",$aSource[1]) RunWait('"' & @ComSpec & '" /c "'&@ScriptDir&'\TestFile.html"', '', @SW_HIDE) SplashOff()In attachment there are the Include and the ExpampleYour SpiderEdit: HotFixINETv2.zip Edited May 9, 2008 by GtaSpider www.AutoIt.de - Moderator of the German AutoIt Forum
TomZ Posted May 9, 2008 Posted May 9, 2008 While 1 While 1 ExitLoop WEnd ExitLoop WEnd Can be shortened to While 1 While 1 Exitloop 2 WEnd WEnd
GtaSpider Posted May 9, 2008 Author Posted May 9, 2008 Hello Yeah, ur rigth... But i like the old natural autoit coding On next Upload ill fix that, thank you Your Spider www.AutoIt.de - Moderator of the German AutoIt Forum
ludocus Posted May 9, 2008 Posted May 9, 2008 seems cool, Although I don't know what post or something is..
GtaSpider Posted May 9, 2008 Author Posted May 9, 2008 Hi With post u can receive informations by php. e.g. usernames or passwords.. so u can make an autologin or smth else.. Your Spider www.AutoIt.de - Moderator of the German AutoIt Forum
GtaSpider Posted May 10, 2008 Author Posted May 10, 2008 HiThanks Here is a short example, what $_POST @ php is: PHP POSTYour Spider www.AutoIt.de - Moderator of the German AutoIt Forum
Cyber Posted May 14, 2008 Posted May 14, 2008 SUPERFANTASTIC!!! THANKS!!!! Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
James Posted May 14, 2008 Posted May 14, 2008 This is going to be so bloody useful for Online Compiler. I couldn't parse the JS function! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
GtaSpider Posted May 14, 2008 Author Posted May 14, 2008 Hi Nice idea, James There are a lot of applications to use for. It can do many things, what the IE.au3 can do, but a lot of faster because the IE doesnt have to load. @ludocus: isn't it? Thanks your Spider sry4my bad engl www.AutoIt.de - Moderator of the German AutoIt Forum
Cyber Posted May 15, 2008 Posted May 15, 2008 not work for me _INetGetSourcePost("http://www....../page.php","var1=val1&var2=val2") Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
GtaSpider Posted May 16, 2008 Author Posted May 16, 2008 Hi Wich error return the Function? Spider www.AutoIt.de - Moderator of the German AutoIt Forum
mary Posted May 16, 2008 Posted May 16, 2008 And what about Accept-Encoding: compress, gzip header ? is there a pure stream decompression ?
Cyber Posted May 17, 2008 Posted May 17, 2008 no error return. i read the first post. i cant send string? need dll? what dll? thanks Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
GtaSpider Posted May 17, 2008 Author Posted May 17, 2008 Hi Cyber! No, you dont need a dll or somthing like this. Does the Example work by you? Your Spider www.AutoIt.de - Moderator of the German AutoIt Forum
Cyber Posted May 20, 2008 Posted May 20, 2008 Your example work dl.start is the name of variable? Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
GtaSpider Posted May 20, 2008 Author Posted May 20, 2008 (edited) HiNo, dl.start is the name. Look at the Source:<tr><td><b>Bitte den Download-Typ wählen:</td><td align="center"><input type="submit" name="dl.start" value="PREMIUM"></td><td align="center"><input type="submit" name="dl.start" value="Free"></td></tr>Here you see, if you push the "Free" button on http://rs255.rapidshare.com/files/110695594/cardr.rar , he sending POST with name dl.start and Value free (name=Value in this example dl.start=Free)Your Spider Edited May 20, 2008 by GtaSpider www.AutoIt.de - Moderator of the German AutoIt Forum
Cyber Posted May 21, 2008 Posted May 21, 2008 ok I try to get with PHP: echo $HTTP_POST[$test]; and your program, but not arrive the return Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now