This code snippet downloads an identity from Fake Name Generator and even parses it all for you so that you can immediately use the data. It only takes a few seconds to implement and works really well. You can remove unnecessary fields if you don't want to use them. It's already URLEncoded - the street, for example, is 123+Name+Street. The RegEx is pretty advanced if you don't know how it works and I'd be happy to explain exactly how this script works to anyone. Please give credit if you use because it did take a while to get fully working.
Code:; Fetch the fake name generator page UrlDownloadToFile, http://www.fakenamegenerator.com/, fng.htm FileRead, fng, fng.htm FileDelete, fng.htm ; Parse out the vCard URL that has all the important info regex := "(?<=/vcard.php\?identity=).?(?="">)" RegExMatch(fng, regex, info) ; Separate the data into separate strings StringReplace, info, info, --, /, All ; Workaround to allow AHK to use more than one character as a delimiter in a parse loop Loop, Parse, info, / { if A_Index = 1 firstName = %A_LoopField% if A_Index = 2 lastName = %A_LoopField% if A_Index = 3 street = %A_LoopField% if A_Index = 4 zipCode = %A_LoopField% if A_Index = 5 state = %A_LoopField% if A_Index = 6 city = %A_LoopField% if A_Index = 7 phone = %A_LoopField% if A_Index = 8 birthDay = %A_LoopField% if A_Index = 9 birthMonth = %A_LoopField% if A_Index = 10 birthYear = %A_LoopField% if A_Index = 11 email = %A_LoopField% } ; Here's en example that shows you all the data MsgBox, Hello, %firstName% %lastName%. Do you still live at %street% in %city%, %state% %zipCode%? Is your phone number %phone% and your birth date %birthMonth%-%birthDay%-%birthYear%? Good day.


LinkBack URL
About LinkBacks
Reply With Quote
