Created
September 5, 2011 19:57
-
-
Save marcpalmer/1195788 to your computer and use it in GitHub Desktop.
Weceem data feed example
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
<g:set var="feedURL" value="http://feeds.bbci.co.uk/news/rss.xml"/> | |
<g:set var="feedData" | |
value="${new URL(feedURL).text}"/> | |
<g:set var="feedDOM" | |
value="${new XmlSlurper().parseText(feedData)}"/> | |
<h2>News</h2> | |
<ul> | |
<g:each in="${feedDOM.channel.item[0..4]}" var="item"> | |
<li> | |
<a href="${item.link.encodeAsHTML()}"> | |
${item.title.encodeAsHTML()}</a> | |
</li> | |
</g:each> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment