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.
Categories: Geekiness
Tagged: programming, ruby
- Published:
- Feb 11, 2010 – 6:35 pm
- Author:
- By Greg Moreno
#11 Either you code it so simple there are obviously no deficiencies or so complicated that there are no obvious deficiencies
#12 In a room full of expert software designers, if any two agree, that’s a majority. Bill Curtis
#13 When in doubt, use brute force. Butler Lampson
#14 You are not in the business of developing software. [...]
Categories: Geekiness
Tagged: programming
- Published:
- Dec 13, 2009 – 4:58 pm
- Author:
- By Greg Moreno
#1 The more dogmatic you are about applying a design method, the fewer real-life problems you are going to solve – P.J. Plauger
#2 Let Ruby be Ruby. Let Java be Java. Let Python be Python. Don’t expect it to be Erlang, because it isn’t.
#3.1 Plan to throw one away; you will, anyhow. – Fred Brooks
#3.2 [...]
Categories: Geekiness
Tagged: programming
- Published:
- Nov 30, 2009 – 4:57 pm
- Author:
- By Greg Moreno
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 techniques or SEO. One such technique involves URLs.
Given a default URL in Rails, e.g. http://cia.gov/users/123, we know as developers that this request involves the [...]
Categories: Geekiness
Tagged: programming, ruby
- Published:
- Aug 24, 2009 – 9:52 pm
- Author:
- By Greg Moreno
Rails’ validations is great because it allows you to quickly implement the valid states of your models and at the same time have a ready-made way of displaying the errors to your users. For example, below is a screenshot of a registration form written with just a few lines of code:
However, this approach requires [...]
Categories: Geekiness
Tagged: programming, ruby
- Published:
- Jul 24, 2009 – 10:17 am
- Author:
- By Greg Moreno