Skip to content

Instantly share code, notes, and snippets.

@duxins
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save duxins/31ed5eb8e0be88a12e31 to your computer and use it in GitHub Desktop.

Select an option

Save duxins/31ed5eb8e0be88a12e31 to your computer and use it in GitHub Desktop.
Create RSS Feeds
require('rss')
rss = RSS::Maker.make("atom") do |maker|
maker.channel.author = "Xin Du"
maker.channel.updated = Time.now.to_s
maker.channel.about = "#{@url}"
maker.channel.title = "RSS"
maker.channel.icon = icon_url
maker.channel.logo = icon_url
feeds.each do |feed|
maker.items.new_item do |item|
item.link = feed[:link]
item.title = feed[:title]
item.description = feed[:description]
item.updated = Time.now.to_s
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment