RosettaCodeData/Task/Web-scraping/Groovy/web-scraping.groovy

9 lines
243 B
Groovy
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
def time = "unknown"
def text = new URL('http://tycho.usno.navy.mil/cgi-bin/timer.pl').eachLine { line ->
def matcher = (line =~ "<BR>(.+) UTC")
if (matcher.find()) {
time = matcher[0][1]
}
}
println "UTC Time was '$time'"