Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (16 sloc) 0.545 kB
class Xkcd < Comic
site_name "xkcd"
site_url "http://www.xkcd.com"
feed_url "http://www.xkcd.com/rss.xml"
def map_routine(xml)
latest = xml.channel.items[0]
if latest
self.description = latest.title
self.posted_on = Date.parse(latest.pubDate.to_s)
self.image_url = latest.description.match(/http:\/\/imgs\.xkcd\.com\/comics\/[^\/]+\.png/).to_s
self.permalink = latest.link
extra_match = latest.description.match(/title="([^"]+)"/)
self.extra = extra_match[1].to_s
end
end
end
Jump to Line
Something went wrong with that request. Please try again.