Go Back   Gaming Gutter > Non-Gaming > Programming > Source Code


Source Code - Have a source code/project files you want to post? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» GG Stuff

Follow us on Twitter!

Get the GG toolbar today (for firefox only)
» Recent Threads
Go to first new post Post Your Picture (Read...
10-09-2006 11:34 PM
by Ryan
Last post by Fran
Today 08:51 PM
14,280 Replies, 247,530 Views
Go to first new post I wanted to say hi
Today 08:45 PM
by Fran
Last post by Ruzzeh
Today 08:51 PM
2 Replies, 3 Views
Go to first new post What are you currently...
09-12-2008 03:16 PM
by Ocean
Last post by Ruzzeh
Today 08:50 PM
2,953 Replies, 23,876 Views
Go to first new post ~ The Official Hash...
11-06-2009 10:56 AM
by mehike
Last post by _KFC_
Today 08:41 PM
911 Replies, 20,808 Views
Go to first new post First.. car attempt...
03-13-2010 03:40 AM
by Sin
Last post by Saint
Today 08:38 PM
6 Replies, 110 Views
Reply
 
LinkBack Thread Tools Display Modes

 Super Simple Neo Acct Age Checker
Old 05-02-2009, 04:02 PM   #1 (permalink)
( * )( * )

Male The Elite is offline
 
Join Date: Mar 2007
Location: Ohio
Age: 21
Posts: 948
GPoints: 7,881
iTrader: 19 / 100%
The Elite Is a Party CaptainThe Elite Is a Party CaptainThe Elite Is a Party Captain
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"
  Reply With Quote
The Following User Says Thank You to The Elite For This Useful Post:
Fexxel (05-03-2009)

 
Old 05-02-2009, 04:16 PM   #2 (permalink)
Sid
Site Programmer

Male Sid is offline
 
Join Date: Sep 2006
Location: Sheffield, UK
Posts: 271
GPoints: 6,178
iTrader: 0 / 0%
Sid Is a Party CaptainSid Is a Party CaptainSid Is a Party Captain
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
__________________
  Reply With Quote

 
Old 05-02-2009, 04:26 PM   #3 (permalink)
( * )( * )

Male The Elite is offline
 
Join Date: Mar 2007
Location: Ohio
Age: 21
Posts: 948
GPoints: 7,881
iTrader: 19 / 100%
The Elite Is a Party CaptainThe Elite Is a Party CaptainThe Elite Is a Party Captain
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"
  Reply With Quote

 
Old 05-02-2009, 06:58 PM   #4 (permalink)
Banned

Male Restocker is offline
 
Join Date: Mar 2009
Location: Detroit
Posts: 295
GPoints: 2,453
iTrader: 11 / 100%
Restocker Is Recognizable
Rep Power: 0
It's cool looking at how you code things, haha. :P
  Reply With Quote

 
Old 05-02-2009, 11:42 PM   #5 (permalink)
Full Member

Female ambience is offline
 
ambience's Avatar
 
Join Date: Apr 2009
Location: Australia
Age: 18
Posts: 126
GPoints: 1,425
iTrader: 0 / 0%
ambience Is Recognizable
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..
  Reply With Quote

 
Old 05-03-2009, 01:00 PM   #6 (permalink)
Full Member

Male Violent_J is offline
 
Violent_J's Avatar
 
Join Date: Nov 2006
Location: Sacramento, California
Age: 18
Posts: 1,057
GPoints: 5,449
iTrader: 5 / 100%
Violent_J Is a Party CaptainViolent_J Is a Party CaptainViolent_J Is a Party Captain
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.
__________________
  Reply With Quote

 
Old 05-03-2009, 01:04 PM   #7 (permalink)
Sid
Site Programmer

Male Sid is offline
 
Join Date: Sep 2006
Location: Sheffield, UK
Posts: 271
GPoints: 6,178
iTrader: 0 / 0%
Sid Is a Party CaptainSid Is a Party CaptainSid Is a Party Captain
Rep Power: 13
Quote:
Originally Posted by Violent_J View Post
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.
__________________
  Reply With Quote

 
Old 05-03-2009, 01:13 PM   #8 (permalink)
Full Member

Male Violent_J is offline
 
Violent_J's Avatar
 
Join Date: Nov 2006
Location: Sacramento, California
Age: 18
Posts: 1,057
GPoints: 5,449
iTrader: 5 / 100%
Violent_J Is a Party CaptainViolent_J Is a Party CaptainViolent_J Is a Party Captain
Rep Power: 14
Quote:
Originally Posted by Sid View Post
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
__________________
  Reply With Quote

 
Old 05-03-2009, 01:19 PM   #9 (permalink)
Sid
Site Programmer

Male Sid is offline
 
Join Date: Sep 2006
Location: Sheffield, UK
Posts: 271
GPoints: 6,178
iTrader: 0 / 0%
Sid Is a Party CaptainSid Is a Party CaptainSid Is a Party Captain
Rep Power: 13
Quote:
Originally Posted by Violent_J View Post
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.
__________________
  Reply With Quote

 
Old 05-03-2009, 01:24 PM   #10 (permalink)
Full Member

Male Violent_J is offline
 
Violent_J's Avatar
 
Join Date: Nov 2006
Location: Sacramento, California
Age: 18
Posts: 1,057
GPoints: 5,449
iTrader: 5 / 100%
Violent_J Is a Party CaptainViolent_J Is a Party CaptainViolent_J Is a Party Captain
Rep Power: 14
Quote:
Originally Posted by Sid View Post
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.
__________________
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBadvanced CMPS v3.1.0

All times are GMT -7. The time now is 08:52 PM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.17793298 seconds (100.00% PHP - 0% MySQL) with 21 queries