Created
March 12, 2009 01:39
-
-
Save jeffrydegrande/77858 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# small script to check on your protocolo | |
require 'rubygems' | |
require 'mechanize' | |
require 'hpricot' | |
url = 'https://servicos.dpf.gov.br/SincreWeb/protocolo' | |
agent = WWW::Mechanize.new | |
page = agent.get(url) | |
form = page.forms.first | |
form.nrprot = ARGV[0] | |
page = agent.submit(form) | |
doc = Hpricot(page.body) | |
puts (doc/'font[@class=simboloObrigatorio]').inner_html.gsub(/<\/?[^>]*>|\n|\t/, "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment