Tuesday, August 11, 2009

Groovy Web Console

Here is a neat little site that provides a web based Groovy console with the ability to run Groovy scripts. It is deployed on the Google App Engine (very cool idea).

Just for fun, here is a little groovy script to read a CNN feed. This is also running as a bot within our environment:

def url = "http://rss.cnn.com/rss/cnn_topstories.rss"
println 'The top three news items today:'
def items = new XmlParser().parse(url).channel[0].item
for (item in items[0..2]) {
println "${item.title.text()} - ${item.link.text()}"
println item.description.text()
println '----'