Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SF Coders] Get Steam Creation Date using Regex
#1
[Image: YzwzC.png]

Hey guys!

I have been working on a Steam Account Checker for sale at HF and ran into a pickle when trying to get the Index number of a line in a string (Not as easy as I thought, I may have been trying to hard) But anyway, I found a way to find the date on a Steam Profile Page of when it was created and when you were first friends, if you have ever been Friends.

This was easier to implement and less lines of code were used, Margin of error is slightly greater although it's nothing to worry about.

Make sure to;
PHP Code:
Imports System.Text.RegularExpressions 

I'm going to be using my profile and downloading the source code using a Web Client.
PHP Code:
Dim WC As New WebClient
Dim Profile 
As String WC.DownloadString("http://steamcommunity.com/profiles/76561197999160354/"

Now that we have the source code of my profile, Let's get the date in which it was created using Regex.

[Image: ?h=84c68f600a992a37b5ec2ef2c82f61dc]

This will get any Month, Date and Year on the webpage (Not including errors for dates prior to Steam's Launch or end of world Apocalypse etc.)

I know that it's a mouthful to type out, so here is the Reg experession on it's own to save you some time.

PHP Code:
"((?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Sept|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?))(\s+)((?:(?:[0-2]?\d{1})|(?:[3][01]{1})))(?![\d])(.)(\s+)((?:(?:[1]{1}\d{1}\d{1}\d{1})|(?:[2]{1}\d{3})))(?![\d])" 

I hope that helps people!

Enjoy,
Milopeach.
"If you cannot explain something simply, then you do not understand it at all." - Albert Einstein
"The best way to predict the future is to invent it." - Alan Kay
Reply
#2
Thank you very much for this... It has also been bookmarked Smile
Reply
#3
That's regex and a half. Smile

Nice work, Milopeach..
Reply
#4
Haha, another great release Milo, I'm so glad I added you into the SF Coders, you're the best member we've got, well done!
Reply
#5
(12-05-2011, 09:04 AM)BreShiE Wrote: Haha, another great release Milo, I'm so glad I added you into the SF Coders, you're the best member we've got, well done!

Thanks for the kind words Breshie! I'll be posting more tutorials and projects as well. I'm also waiting on another SF Coders project. Smile
"If you cannot explain something simply, then you do not understand it at all." - Albert Einstein
"The best way to predict the future is to invent it." - Alan Kay
Reply
#6
*Bookmarked*
Geeze i have so many SF and HF bookmarks now :3
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SF Coders - Icon Changer - Project 1 Arron XR 14 4,521 09-11-2012, 08:20 PM
Last Post: malis2007
  [SF Coders]Imageshack.Us Image Scraper ★Cooldude★ 7 3,207 08-28-2012, 01:47 AM
Last Post: ★Cooldude★
  [VB.Net] Theme Steam HF~Legend 0 2,157 07-01-2012, 05:42 PM
Last Post: HF~Legend
  [SF Coders] Grabbing an Icon from a File and Saving! [TUT] milopeach 13 3,809 05-15-2012, 06:22 PM
Last Post: OnyxDev
  [SF Coders] Password Generator ★Cooldude★ 23 11,885 03-19-2012, 06:40 PM
Last Post: AceInfinity

Forum Jump:


Users browsing this thread: 3 Guest(s)