phatzilla Posted February 26, 2011 Share Posted February 26, 2011 (edited) So I need to access a PHP page that has ~600 lines of data (lines are dynamic -- Different every time you visit the page) The lines are also each a different length. Line1 Line2 Line3 .. . ~Line600 What i need to do is Have Autoit parse the lines on the Page Hash Every single Line Via MD5 Save every Hashed Line into a Textfile (1 Hash Per Line) I already Use the MD5 UDF (Found here : ) Preciate The help, thanks guys Edited February 26, 2011 by phatzilla Link to comment Share on other sites More sharing options...
phatzilla Posted February 26, 2011 Author Share Posted February 26, 2011 (edited) I tried $textfile = "parsed.txt" InetGet("http://www.website.com", $textfile, 1) But it's all clumped up together with the <BR> tags which are useless to me. Would it be a good idea to replace the BR tags with @CRLF? Or is this just a roundabout way of doing things from scratch? Edited February 26, 2011 by phatzilla Link to comment Share on other sites More sharing options...
phatzilla Posted February 26, 2011 Author Share Posted February 26, 2011 (edited) Okay, i figured out the first part. $szFile = "parsed.txt" $szText = FileRead($szFile,FileGetSize($szFile)) $szText = StringReplace($szText, "<br>", @CRLF) FileDelete($szFile) FileWrite($szFile,$szText) That replaces the <BR> tags with @CRLF which gives me fresh lines yay Now the next step is how to Hash each line with MD5 and replace the file with the output. Edited February 26, 2011 by phatzilla Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 26, 2011 Share Posted February 26, 2011 I'm not sure how the MD5 function takes input, but try it something like this way: $szText = MD5Function(StringReplace($szText, "<br>", @CRLF)) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
phatzilla Posted February 26, 2011 Author Share Posted February 26, 2011 (edited) Tried that, it gave me gibberish. All i really need now is to use the _MD5 Function to hash every line of the previously edited text file $Hash = _MD5('The quick brown fox jumps over the lazy dog') Edited February 26, 2011 by phatzilla Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 26, 2011 Share Posted February 26, 2011 $szFile needs to be read and 'processed' one line at a time. Try the FileReadLine function. The example in the Docs is probably all you need to get you going. Good luck. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
phatzilla Posted February 26, 2011 Author Share Posted February 26, 2011 (edited) I'm a total numbskull, but it doesnt seem to be saving each line with the hashed values #include "md5.au3" $file = FileOpen("PARSEDURLS\parsed1.txt", 0) ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) $Hash = _MD5($line) $MD5 = Hex($Hash) ; IMPORTANT, REMOVES 0X Wend FileClose($file) Any ideas Edited February 26, 2011 by phatzilla Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 26, 2011 Share Posted February 26, 2011 (edited) The line needs to be written (to a new file. It can be renamed later..) after it is 'processed' (this'll be the last step in the While loop..). See the FileWriteLine function.<br><br>Edit: added last step thing..<br> Edited February 26, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
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