25 lines
578 B
Text
25 lines
578 B
Text
use Net;
|
|
use IO;
|
|
use Structure;
|
|
|
|
bundle Default {
|
|
class Scrape {
|
|
function : Main(args : String[]) ~ Nil {
|
|
client := HttpClient->New();
|
|
lines := client->Get("http://tycho.usno.navy.mil/cgi-bin/timer.pl", 80);
|
|
|
|
i := 0;
|
|
found := false;
|
|
while(found <> true & i < lines->Size()) {
|
|
line := lines->Get(i)->As(String);
|
|
index := line->Find("UTC");
|
|
if(index > -1) {
|
|
time := line->SubString(index - 9, 9)->Trim();
|
|
time->PrintLine();
|
|
found := true;
|
|
};
|
|
i += 1;
|
|
};
|
|
}
|
|
}
|
|
}
|