Last active
August 29, 2015 14:08
-
-
Save duxins/31ed5eb8e0be88a12e31 to your computer and use it in GitHub Desktop.
Create RSS Feeds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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