Sign in to follow this  
Followers 0
PartyPooper

Getting program version from a webpage

4 posts in this topic

Is it possible to extract the version number from the following webpage?

http://forum.rustoxide.com/resources/rustrcon-admin-tool-32-bit.434/

 

What I'm looking for is a way to consistently extract the version string (currently '2014.3.7.3762').

Sorry, I can't provide a function example because I have no idea on where to begin having never interacted with styled webpages before.  I haven't been able to find a UDF in the Help file that finds a particular line in a webpage (at least not yet).

I was thinking about putting the entire page into an array after removing all whitespace and simply searching for the array index that contains <h1>RustRCON Admin Tool (32 bit) <span class="muted">, however, I don't know if this is the right (or even correct) method to use.  Pointers would be appreciated.

Share this post


Link to post
Share on other sites



You could use InetRead to get the page contents into a variable and then parse out the version info from there.

Share this post


Link to post
Share on other sites

Hello,

Something like this could work:

$bSource = InetRead("http://forum.rustoxide.com/resources/rustrcon-admin-tool-32-bit.434/")
$sSource = BinaryToString($bSource)
$aVersion = StringRegExp($sSource, "(?i)<h3>Version\s(.+?)</h3>", 1)
ConsoleWrite("Current version is: " & $aVersion[0] & @CRLF)

Cheers,

sahsanu

Share this post


Link to post
Share on other sites

Thanks Sahsanu, I wouldn't have believed it could be done in 4 lines :thumbsup:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0