Posted By

alces on 02/27/13


Tagged

rss regexp find gsp XmlParser


Versions (?)

CBC World News RSS parser


 / Published in: Groovy
 

URL: cbc_world_news_gsp

Reads CBC news RSS with fancy-prints its in table, splitting news description by image & text.

  1. <table border=0 align=center>
  2. <%
  3. new XmlParser().parse('http://rss.cbc.ca/lineup/world.xml').channel.item.each {
  4. it.description.text().find('(<img [^>]+>).*<p>([^<]+)</p>') {mtc, img, txt ->
  5. out << """<tr><td rowspan=2>$img</td><th>${it.title.text()}</th></tr>
  6. <tr><td>$txt</td></tr>"""
  7. }
  8. }
  9. %>
  10. </table>

Report this snippet  

You need to login to post a comment.