RosettaCodeData/Task/Web-scraping/8th/web-scraping.8th

15 lines
298 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
\ Web-scrape sample: get UTC time from the US Naval Observatory:
: read-url \ -- s
"http://tycho.usno.navy.mil/cgi-bin/timer.pl" net:get
not if "Could not connect" throw then
>s ;
: get-time
read-url
2018-06-22 20:57:24 +00:00
/<BR>.*?(\d{2}:\d{2}:\d{2})\sUTC/
2016-12-05 23:44:36 +01:00
tuck r:match if
1 r:@ . cr
then ;
get-time bye