Support Forums

Full Version: [SF Coders] Get Steam Creation Date using Regex
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[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.
Thank you very much for this... It has also been bookmarked Smile
That's regex and a half. Smile

Nice work, Milopeach..
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!
(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
*Bookmarked*
Geeze i have so many SF and HF bookmarks now :3