Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Web-scraping/Objeck/web-scraping.objeck
Normal file
25
Task/Web-scraping/Objeck/web-scraping.objeck
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue