Skip to content

Instantly share code, notes, and snippets.

@nathanclark
Created March 24, 2010 22:49
Show Gist options
  • Save nathanclark/342922 to your computer and use it in GitHub Desktop.
Save nathanclark/342922 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we’re interested in...
doc = Nokogiri::HTML(open('http://www.facebook.com/ChickfilA?v=wall','User-Agent' => 'Mozilla/5.0 (...) Firefox/3.0.6'))
# Do funky things with it using Nokogiri::XML::Node methods...
####
# Search for nodes by css
doc.css('.UIStory_Message').each do |link|
puts link.content
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment