Jump to content

Pulling Data from a Webpage, MD5 Hashing it, And storing IN a Text file.


 Share

Recommended Posts

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 by phatzilla
Link to comment
Share on other sites

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 by phatzilla
Link to comment
Share on other sites

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 by phatzilla
Link to comment
Share on other sites

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 by phatzilla
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...