Skip to content

Instantly share code, notes, and snippets.

@andersonfreitas
Forked from bragi/htmlgrep.rb
Created June 10, 2011 18:59
Show Gist options
  • Save andersonfreitas/1019517 to your computer and use it in GitHub Desktop.
Save andersonfreitas/1019517 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'rubygems'
require 'hpricot'
require 'open-uri'
file = open(ARGV[1]) if ARGV[1]
file ||= STDIN
doc = Hpricot(file)
puts doc / ARGV[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment