Created
February 22, 2012 12:58
-
-
Save kdabir/1885022 to your computer and use it in GitHub Desktop.
Parsing rss in groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define the url | |
def url = "http://news.google.com/news?ned=us&topic=h&output=rss" | |
def rss = new XmlSlurper().parse(url) | |
println rss.channel.title | |
rss.channel.item.each { | |
println "- ${it.title}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
only open and read from an URL directly if you trust that URL!