Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Created January 29, 2010 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdelStrother/289611 to your computer and use it in GitHub Desktop.
Save jdelStrother/289611 to your computer and use it in GitHub Desktop.
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