RosettaCodeData/Task/Web-scraping/Objeck/web-scraping.objeck
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

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;
};
}
}
}