Task

Create a program that downloads the time from this URL:   http://tycho.usno.navy.mil/cgi-bin/timer.pl   and then prints the current UTC time by extracting just the UTC time from the web page's HTML. Alternatively, if the above url is not working, grab the first date/time off this page's talk page.



If possible, only use libraries that come at no extra monetary cost with the programming language and that are widely available and popular such as CPAN for Perl or Boost for C++.




alias utc {
  sockclose UTC
  sockopen UTC tycho.usno.navy.mil 80
}
 
on *:SOCKOPEN:UTC: {
  sockwrite -n UTC GET /cgi-bin/timer.pl HTTP/1.1
  sockwrite -n UTC Host: tycho.usno.navy.mil
  sockwrite UTC $crlf
}
 
on *:SOCKREAD:UTC: {
  sockread %UTC
  while ($sockbr) {
    if (<BR>*Universal Time iswm %UTC) {
      echo -ag $remove(%UTC,<BR>,$chr(9),Universal Time)
      unset %UTC
      sockclose UTC
      return
    }
    sockread %UTC
  }
}