» Site Navigation | | | » Advertisement | | | » Recent Threads | | | | | | | | | | | |  |  | Super Simple Neo Acct Age Checker |  |
05-02-2009, 04:02 PM
|
#1 (permalink)
| ( * )( * )
Join Date: Mar 2007 Location: Ohio Age: 21 Posts: 948
GPoints: 7,881 Rep Power: 0 | Super Simple Neo Acct Age Checker This is a really really simple age checker I put together one day as a request:
It also makes it a bit "neater"
ex: Instead of 54mth it'll print it as 54 Months.
REALLY Simple: Quote:
strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & Text2, "http://www.neopets.com")
Label9.Caption = GetStringBetween(strhtml, "images.neopets.com/images/shields/", ".gif"" width=""100"" height=""15")
Pause (2)
If Label9.Caption = "newbie" Then Label4.Caption = "Newbie"
If Label9.Caption = "1wk" Then Label4.Caption = "1 Week"
If Label9.Caption = "2wk" Then Label4.Caption = "2 Weeks"
If Label9.Caption = "3wk" Then Label4.Caption = "3 Weeks"
If Label9.Caption = "1mth" Then Label4.Caption = "1 Month"
If Label9.Caption = "2mth" Then Label4.Caption = "2 Months"
If Label9.Caption = "3mth" Then Label4.Caption = "3 Months"
If Label9.Caption = "4mth" Then Label4.Caption = "4 Months"
If Label9.Caption = "5mth" Then Label4.Caption = "5 Months"
If Label9.Caption = "6mth" Then Label4.Caption = "6 Months"
If Label9.Caption = "7mth" Then Label4.Caption = "7 Months"
If Label9.Caption = "8mth" Then Label4.Caption = "8 Months"
If Label9.Caption = "9mth" Then Label4.Caption = "9 Months"
If Label9.Caption = "10mth" Then Label4.Caption = "10 Months"
If Label9.Caption = "11mth" Then Label4.Caption = "11 Months"
If Label9.Caption = "12mth" Then Label4.Caption = "12 Months"
If Label9.Caption = "13mth" Then Label4.Caption = "13 Months"
If Label9.Caption = "14mth" Then Label4.Caption = "14 Months"
If Label9.Caption = "15mth" Then Label4.Caption = "15 Months"
If Label9.Caption = "16mth" Then Label4.Caption = "16 Months"
If Label9.Caption = "17mth" Then Label4.Caption = "17 Months"
If Label9.Caption = "18mth" Then Label4.Caption = "18 Months"
If Label9.Caption = "19mth" Then Label4.Caption = "19 Months"
If Label9.Caption = "20mth" Then Label4.Caption = "20 Months"
If Label9.Caption = "21mth" Then Label4.Caption = "21 Months"
If Label9.Caption = "22mth" Then Label4.Caption = "22 Months"
If Label9.Caption = "23mth" Then Label4.Caption = "23 Months"
If Label9.Caption = "24mth" Then Label4.Caption = "24 Months"
If Label9.Caption = "25mth" Then Label4.Caption = "25 Months"
If Label9.Caption = "26mth" Then Label4.Caption = "26 Months"
If Label9.Caption = "27mth" Then Label4.Caption = "27 Months"
If Label9.Caption = "28mth" Then Label4.Caption = "28 Months"
If Label9.Caption = "29mth" Then Label4.Caption = "29 Months"
If Label9.Caption = "30mth" Then Label4.Caption = "30 Months"
If Label9.Caption = "31mth" Then Label4.Caption = "31 Months"
If Label9.Caption = "32mth" Then Label4.Caption = "32 Months"
If Label9.Caption = "33mth" Then Label4.Caption = "33 Months"
If Label9.Caption = "34mth" Then Label4.Caption = "34 Months"
If Label9.Caption = "35mth" Then Label4.Caption = "35 Months"
If Label9.Caption = "36mth" Then Label4.Caption = "36 Months"
If Label9.Caption = "37mth" Then Label4.Caption = "37 Months"
If Label9.Caption = "38mth" Then Label4.Caption = "38 Months"
If Label9.Caption = "39mth" Then Label4.Caption = "39 Months"
If Label9.Caption = "40mth" Then Label4.Caption = "40 Months"
If Label9.Caption = "41mth" Then Label4.Caption = "41 Months"
If Label9.Caption = "42mth" Then Label4.Caption = "42 Months"
If Label9.Caption = "43mth" Then Label4.Caption = "43 Months"
If Label9.Caption = "44mth" Then Label4.Caption = "44 Months"
If Label9.Caption = "45mth" Then Label4.Caption = "45 Months"
If Label9.Caption = "46mth" Then Label4.Caption = "46 Months"
If Label9.Caption = "47mth" Then Label4.Caption = "47 Months"
If Label9.Caption = "48mth" Then Label4.Caption = "48 Months"
If Label9.Caption = "49mth" Then Label4.Caption = "49 Months"
If Label9.Caption = "50mth" Then Label4.Caption = "50 Months"
If Label9.Caption = "51mth" Then Label4.Caption = "51 Months"
If Label9.Caption = "52mth" Then Label4.Caption = "52 Months"
If Label9.Caption = "53mth" Then Label4.Caption = "53 Months"
If Label9.Caption = "54mth" Then Label4.Caption = "54 Months"
If Label9.Caption = "55mth" Then Label4.Caption = "55 Months"
If Label9.Caption = "56mth" Then Label4.Caption = "56 Months"
If Label9.Caption = "57mth" Then Label4.Caption = "57 Months"
If Label9.Caption = "58mth" Then Label4.Caption = "58 Months"
If Label9.Caption = "59mth" Then Label4.Caption = "59 Months"
If Label9.Caption = "60mth" Then Label4.Caption = "60 Months"
If Label9.Caption = "61mth" Then Label4.Caption = "61 Months"
If Label9.Caption = "62mth" Then Label4.Caption = "62 Months"
If Label9.Caption = "63mth" Then Label4.Caption = "63 Months"
If Label9.Caption = "64mth" Then Label4.Caption = "64 Months"
If Label9.Caption = "65mth" Then Label4.Caption = "65 Months"
If Label9.Caption = "66mth" Then Label4.Caption = "66 Months"
If Label9.Caption = "67mth" Then Label4.Caption = "67 Months"
If Label9.Caption = "68mth" Then Label4.Caption = "68 Months"
If Label9.Caption = "69mth" Then Label4.Caption = "69 Months"
If Label9.Caption = "70mth" Then Label4.Caption = "70 Months"
If Label9.Caption = "71mth" Then Label4.Caption = "71 Months"
If Label9.Caption = "72mth" Then Label4.Caption = "72 Months"
If Label9.Caption = "6_0_years" Then Label4.Caption = "6 Years"
If Label9.Caption = "6_5_years" Then Label4.Caption = "6.5 Years"
If Label9.Caption = "7_0_years" Then Label4.Caption = "7 Years"
If Label9.Caption = "7_5_years" Then Label4.Caption = "7.5 Years"
If Label9.Caption = "8_0_years" Then Label4.Caption = "8 Years"
If Label9.Caption = "8_5_years" Then Label4.Caption = "8.5 Years"
If Label9.Caption = "9_0_years" Then Label4.Caption = "9 Years"
If Label9.Caption = "9_5_years" Then Label4.Caption = "9.5 Years"
| | |
| | | The Following User Says Thank You to The Elite For This Useful Post: | |
05-02-2009, 04:16 PM
|
#2 (permalink)
| Site Programmer
Join Date: Sep 2006 Location: Sheffield, UK Posts: 271
GPoints: 6,178 Rep Power: 13 | I'd do it like this: Code: Public Function GetAge(ByVal Username As String)
Dim strHTML As String
Dim Age As String
strHTML = wrapper.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & Username)
Age = GetStringBetween(strHTML, "images.neopets.com/images/shields/", ".gif"" width=""100"" height=""15")
If Age = "newbie" Then
Return "Newbie"
ElseIf Age.Contains("1wk") Then
Return "1 Week"
ElseIf Age.Contains("wk") Then
Return Replace(Age, "wk", " Weeks")
ElseIf Age.Contains("1mth") Then
Return "1 Month"
ElseIf Age.Contains("mth") Then
Return Replace(Age, "mth", " Months")
ElseIf Age.Contains("years") Then
Dim Temp As String
Temp = Replace(Age, "_", ".")
Temp = Replace(Temp, ".years", " Years")
Return Temp
Else : Return "WTF Yo"
End If
End Function
__________________ | |
| |  |
05-02-2009, 04:26 PM
|
#3 (permalink)
| ( * )( * )
Join Date: Mar 2007 Location: Ohio Age: 21 Posts: 948
GPoints: 7,881 Rep Power: 0 | Works as well...
I just wanted to show the MOST possible way so people could learn how its used.
But yours is alot better "optimized" | |
| |
05-02-2009, 06:58 PM
|
#4 (permalink)
| Banned
Join Date: Mar 2009 Location: Detroit Posts: 295
GPoints: 2,453 Rep Power: 0 | It's cool looking at how you code things, haha. :P | |
| |  | |  |
05-02-2009, 11:42 PM
|
#5 (permalink)
| Full Member
Join Date: Apr 2009 Location: Australia Age: 18 Posts: 126
GPoints: 1,425 Rep Power: 3 | This inspired me to write a random version in Python (version 2.5.2, I don't think this'll work in the new version of Python where print is a function, not a statement): Code: import urllib, re
username = raw_input("Enter username to check ")
url = "http://www.neopets.com/userlookup.phtml?user=" + username
html = urllib.urlopen(url).read()
pattern = re.compile(r"(images.neopets.com/images/shields/)(\w+)(\.gif)")
result = re.search(pattern, html).group(2)
age = re.search(r"(\d+?)((wk)|(mth))", result)
mapping = {"wk": "weeks",
"mth": "months"}
if age:
print age.group(1), mapping[age.group(2)]
else:
if not result:
print "Account doesn't exist"
if result == "newbie":
print "Newbie"
else:
print ".".join(result.split("_")[:2]), "years" It's pretty bad, my Python is a bit rusty.  but I felt like a programming exercise. And I learned something about urllib. 
__________________ Nobody said it was easy; no one ever said it would be so hard
Last edited by ambience; 05-03-2009 at 01:33 AM..
| |
| |  |
05-03-2009, 01:00 PM
|
#6 (permalink)
| Full Member
Join Date: Nov 2006 Location: Sacramento, California Age: 18 Posts: 1,057
GPoints: 5,449 Rep Power: 14 | Isn't it better to go to the neoboards index and getstringbetween the account age there?
Only flaw to my way is if the person is under 13 years, they can't see it. | |
| |
05-03-2009, 01:04 PM
|
#7 (permalink)
| Site Programmer
Join Date: Sep 2006 Location: Sheffield, UK Posts: 271
GPoints: 6,178 Rep Power: 13 | Quote:
Originally Posted by Violent_J Isn't it better to go to the neoboards index and getstringbetween the account age there?
Only flaw to my way is if the person is under 13 years, they can't see it. | It's the age of the account not the user.
__________________ | |
| |
05-03-2009, 01:13 PM
|
#8 (permalink)
| Full Member
Join Date: Nov 2006 Location: Sacramento, California Age: 18 Posts: 1,057
GPoints: 5,449 Rep Power: 14 | Quote:
Originally Posted by Sid It's the age of the account not the user. | ummm no shit
There is more than one way to skin a cat. Code: Dim strHTML As String
Private Sub cmdget_Click()
strHTML = w.GetWrapper("http://www.neopets.com/neoboards/preferences.phtml/")
txtage.Text = Functions.GSB(strHTML, "</i><br />", "<br><b style=")
End Sub This is the first thing I coded in 6 months.
I used it in my account information getter thing I only released on DZ | |
| |
05-03-2009, 01:19 PM
|
#9 (permalink)
| Site Programmer
Join Date: Sep 2006 Location: Sheffield, UK Posts: 271
GPoints: 6,178 Rep Power: 13 | Quote:
Originally Posted by Violent_J ummm no shit
There is more than one way to skin a cat. Code: Dim strHTML As String
Private Sub cmdget_Click()
strHTML = w.GetWrapper("http://www.neopets.com/neoboards/preferences.phtml/")
txtage.Text = Functions.GSB(strHTML, "</i><br />", "<br><b style=")
End Sub This is the first thing I coded in 6 months.
I used it in my account information getter thing I only released on DZ | Since I'm not an obsessive neopets player and that you mentioned if you were under 13 you can't see it I assumed you meant the users age.
Rudeness is not necessary.
__________________ | |
| |
05-03-2009, 01:24 PM
|
#10 (permalink)
| Full Member
Join Date: Nov 2006 Location: Sacramento, California Age: 18 Posts: 1,057
GPoints: 5,449 Rep Power: 14 | Quote:
Originally Posted by Sid Since I'm not an obsessive neopets player and that you mentioned if you were under 13 you can't see it I assumed you meant the users age.
Rudeness is not necessary. | I was rude?
I just talk that way. It was not intended lol
Anyhow, the source I posted works. It feels great to program again.  | |
| |  | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |