Skip to content

Instantly share code, notes, and snippets.

@Syd
Created December 7, 2008 08:51
Show Gist options
  • Select an option

  • Save Syd/33063 to your computer and use it in GitHub Desktop.

Select an option

Save Syd/33063 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'rubygems'
require 'hpricot'
require 'rss/maker'
content = RSS::Maker.make("2.0") do |feed|
feed.channel.title = "gamearena forums - enemy territory"
feed.channel.link = "http://www.gamearena.com.au"
feed.channel.description = "GA ET forums"
doc = Hpricot(open("http://www.gamearena.com.au/forums/et/index.php"))
doc.search('//div[@class="Title"]/a').each do |thread|
item = feed.items.new_item
item.title = thread.inner_html
item.link = "http://www.gamearena.com.au/forums/et/%s" % thread["href"]
item.date = Time.now
end
end
puts content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment