@{ import time, urllib, xml2obj def printHeadlineLinks(root): for story in root.children: for c in story.children: name = c.name if name == "title": title = c.getData() elif name == "url": url = c.getData() print "- `%s <%s>`__ \n" % (title, url) try: url = "http:slashdot.org/slashdot.xml" xmlData = urllib.urlopen(url).read() parser = xml2obj.Xml2Obj() root = parser.ParseString(xmlData) except IOError: root = None } @[if root] Below you can see the list of the very current Slashdot news (as of @time.ctime()). (Don't reload this too often or Slashdot might temporarily ban your IP!) @printHeadlineLinks(root) @[else] Sorry, but there seems to be no Internet connectivity! @[end if] }