Skip to content

Instantly share code, notes, and snippets.

@chrisb
Created February 1, 2012 01:46
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 chrisb/1714454 to your computer and use it in GitHub Desktop.
Save chrisb/1714454 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'rubygems'
require 'open-uri'
require 'nokogiri'
get '/' do
doc = Nokogiri::HTML(open("http://www.google.com"))
balls = []
doc.css('a').each do |node|
balls << node.text
end
balls.map! do |text|
"<div>#{text}</div>"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment