Created
January 29, 2010 09:59
-
-
Save jdelStrother/289611 to your computer and use it in GitHub Desktop.
This file contains 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 'rubygems' | |
require 'feedzirra' | |
def get_feed(url) | |
geotagged_boos = [] | |
elements = {'georss:point' => :location, 'itunes:keywords' => :tags} | |
elements.each do |key, value| | |
Feedzirra::Feed.add_common_feed_entry_element(key, :as => value) | |
end | |
feed = Feedzirra::Feed.fetch_and_parse(url) | |
unless feed.entries.empty? | |
for item in feed.entries | |
unless !item.location | |
geotagged_boos << item | |
end | |
end | |
end | |
geotagged_boos | |
end | |
get_feed('http://audioboo.fm/users/229/boos.atom').map{|e| e.title}.inspect # => "[\"b8\", \"b7\", \"b6\", \"b5\", \"b4\", \"b3\", \"b2\", \"b1\", \"waving\", \"Beckett\", \"custom icons\", \"boo not found\", \"sport relief is live\", \"jelly\", \"cock\", \"freeze\", \"to John\", \"musing\", \"the horror\", \"fan fire for the uncommon man\", \"whiskey and sludge\", \"mucksack podcast\", \"FCC\", \"tube\", \"Christmas clunge\"]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment