.
' Place the piece of script where you want to create the button
string pubStatUri = "http://www.lfsworld.net/pubstat/get_stat2.php?version=1.4&idk=<Your_Ident_Key_Here>&action=hl&racer=Silox";
' This returned a lot of PB's for my account
' Now the requesting part
WebRequest request = WebRequest.Create(pubStatUri);
using (WebResponse response = request.GetResponse())
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
' The streamreader reads every time 1 line from the file, so we'll need a loop
' Save the return info in a string, called line
string line;
' Loop trough all the lines of the file
while (line = reader.ReadLine()) != null)
{
' E.g. I want to get my XFG Bl1 PB
' Which is, on the Pubstat like this:
' 240 XFG 45500 0 0 94230 2 1201295794 (Don't know for sure if it's this one)
' Now we'll modify the code:
' I should cut the code into an array
array results
results = String.split(line)
' If BL1 and XFG
If results(0) = 240 and results(1) = "XFG" then
' Save the total time in Miliseconds
string pb
pb = results(7)
' Exit the loop so it will take less time
exit loop;
}
}