Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Web-scraping/Oz/web-scraping.oz
Normal file
20
Task/Web-scraping/Oz/web-scraping.oz
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
declare
|
||||
[Regex] = {Module.link ['x-oz://contrib/regex']}
|
||||
|
||||
fun {GetPage Url}
|
||||
F = {New Open.file init(url:Url)}
|
||||
Contents = {F read(list:$ size:all)}
|
||||
in
|
||||
{F close}
|
||||
Contents
|
||||
end
|
||||
|
||||
fun {GetDateString Doc}
|
||||
case {Regex.search "<BR>([A-Za-z0-9:., ]+ UTC)" Doc}
|
||||
of match(1:S#E ...) then {List.take {List.drop Doc S} E-S+1}
|
||||
end
|
||||
end
|
||||
|
||||
Url = "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
|
||||
in
|
||||
{System.showInfo {GetDateString {GetPage Url}}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue