Web scraping: Difference between revisions

m
No edit summary
m (→‎{{header|Phix}}: simplified)
Line 1,506:
include builtins\timedate.e
 
curl_easy_setopt(curl,object CURLOPT_URL,res = curl_easy_perform_ex("https://tycho.usno.navy.mil/cgi-bin/timer.pl")
curl_global_init()
atom curl = curl_easy_init()
curl_easy_setopt(curl, CURLOPT_URL, "https://tycho.usno.navy.mil/cgi-bin/timer.pl")
object res = curl_easy_perform_ex(curl)
if string(res) then
res = split(res,'\n')
Line 1,523 ⟶ 1,520:
timedate td = parse_date_string(res, {"Mmm. d, hh:mm:ss"})
td[DT_YEAR] = date()[DT_YEAR]
?format_timedate(td,"h:mpm Dddd Mmmm ddth Mmmm")
?format_timedate(date(),"h:mpm Dddd Mmmm ddth Mmmm")
end if
else
?{"some error" ,res,curl_easy_strerror(res)}
end if</lang>
curl_easy_cleanup(curl)
curl_global_cleanup()</lang>
{{out}}
<pre>
7,795

edits