How to read Google buzz updates in Ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'feedzirra'
profile_name = 'dave.winer'
page = Nokogiri::HTML(open("http://www.google.com/profiles/#{profile_name}"))
feed_url = page.search('//head/link[@type="application/atom+xml"]').first['href']
feed = Feedzirra::Feed.fetch_and_parse(feed_url)
puts feed.title
puts feed.url
puts feed.last_modified
feed.entries.each do |entry|
puts
puts "Title: #{entry.title}"
puts "Content"
puts entry.content
end
I can’t find the Activity Streams tag. Feedzirra could be filtering it but I haven’t look at it yet.
Related posts:
- Ruby 101: How to filter an Array using proc Over at the PhRUG, a Ruby developer community based in the Philippines, we conduct code review sessions via our mailing list. A code is posted and members share alternative implementations....
- Ruby 101: Make your class behave like a Ruby built-in I got re-acquianted with this scenario while working on the OpenAmplify gem – a wrapper for the OpenAmplify API. When you give the api a text like a blog comment,...
- How to create Google-friendly URLs in Rails If you are building content-management systems or any applications with pages that you want to appear in a Google search, it is very important that you employ search engine optimization...
- Ruby 101: How to add methods to a Ruby class Let’s add a method that checks whether an Array has many elements. a = [1,2,3] a.many? # NoMethodError: undefined method `many?' Let’s fix this by adding a new method to...
- How to create a class on the fly in Ruby “So what if Ruby is dynamic?” This is often the reaction I get whenever I tell friends that Ruby allows you to fiddle with your program at runtime; followed by...