Skip to content

Instantly share code, notes, and snippets.

@marcpalmer
Created September 5, 2011 19:57
Show Gist options
  • Save marcpalmer/1195788 to your computer and use it in GitHub Desktop.
Save marcpalmer/1195788 to your computer and use it in GitHub Desktop.
Weceem data feed example
<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