It is currently Fri Sep 10, 2010 9:53 am


Welcome to Mango12!


Mango12 is a programming orientated community that primarily focuses on creating bots, macros, and other such applications to make things on the web easier; from things like simulating game play to submitting web forms. For more info, Read the FAQ or Join the IRC.

All times are UTC



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Get a Fake Name Generator identity
PostPosted: Tue Dec 29, 2009 8:06 pm 
Offline
Forum King
User avatar

Joined: Sat Apr 19, 2008 7:16 pm
Posts: 1253
Location: United States
Given: 53 thanks
Received: 544 thanks
Known Programming Languages: AHK, C#, PHP
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.

  1. ; Fetch the fake name generator page
  2. UrlDownloadToFile, http://www.fakenamegenerator.com/, fng.htm
  3. FileRead, fng, fng.htm
  4. FileDelete, fng.htm
  5.  
  6. ; Parse out the vCard URL that has all the important info
  7. regex := "(?<=/fireform.php\?identity=).*?(?="">)"
  8. RegExMatch(fng, regex, info)
  9.  
  10. ; Separate the data into separate strings
  11. StringReplace, info, info, --, /, All  ; Workaround to allow AHK to use more than one character as a delimiter in a parse loop
  12. Loop, Parse, info, /
  13. {
  14.     if A_Index = 1
  15.         firstName = %A_LoopField%
  16.     if A_Index = 2
  17.         lastName = %A_LoopField%
  18.     if A_Index = 3
  19.         salutation = %A_LoopField%
  20.     if A_Index = 4
  21.         street = %A_LoopField%
  22.     if A_Index = 5
  23.         zipCode = %A_LoopField%
  24.     if A_Index = 6
  25.         state = %A_LoopField%
  26.     if A_Index = 7
  27.         city = %A_LoopField%
  28.     if A_Index = 8
  29.         phone = %A_LoopField%
  30.     if A_Index = 9
  31.         birthDay = %A_LoopField%
  32.     if A_Index = 10
  33.         birthMonth = %A_LoopField%
  34.     if A_Index = 11
  35.         birthYear = %A_LoopField%
  36.     if A_Index = 12
  37.         age = %A_LoopField%
  38.     if A_Index = 13
  39.         email = %A_LoopField%
  40. }


Here's an example of how it could be tested:
  1. email := UrlDecode(email)
  2. StringReplace, city, city, +,%A_Space%, All
  3. StringReplace, street, street, +,%A_Space%, All
  4.  
  5. MsgBox, Name: %salutation% %firstName% %lastName%`nAddress: %street%`nCity: %city%, %state% %zipCode%`nPhone: %phone%`nBirth date: %birthDay%/%birthMonth%/%birthYear%`nAge: %age%`nEmail: %email%
  6. return

_________________
GSN Oodles Answer Database - The original answer database, now serving over eight thousand answers.
gPrize - A fast, lightweight, and customizable Oodles prize checker.


Top
 Profile E-mail  
 
The following 2 users would like to thank nick761 for his or her post:
oneeyedsniper101, theextant
 Post subject: Re: Get a Fake Name Generator identity
PostPosted: Sat Mar 27, 2010 9:08 pm 
Offline
Forum King
User avatar

Joined: Sat Apr 19, 2008 7:16 pm
Posts: 1253
Location: United States
Given: 53 thanks
Received: 544 thanks
Known Programming Languages: AHK, C#, PHP
FakeNameGenerator changed something on their site that prevented this from working. I finally got around to fixing it.

_________________
GSN Oodles Answer Database - The original answer database, now serving over eight thousand answers.
gPrize - A fast, lightweight, and customizable Oodles prize checker.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2007 phpBB Group
xand 2 for phpBB3 by Thomas Hoornstra and Shadow_One reklama