Skip to content

Instantly share code, notes, and snippets.

@norman
Created February 25, 2011 18:02
Show Gist options
  • Save norman/844208 to your computer and use it in GitHub Desktop.
Save norman/844208 to your computer and use it in GitHub Desktop.
require "net/http"
require "uri"
def get_cpa(calle, altura)
url = "http://www3.correoargentino.com.ar/scriptsN/cpa/cpa_calle.idc"
res = Net::HTTP.post_form(URI.parse(url), {
:codloca => "5001",
:pnc => calle,
:alt => altura
})
regexp = /<big><font face="Arial" color="#002B6D"><b>([A-Z0-9]*)<br><\/b><\/font><\/big>/
return res.body.match(regexp)[1]
end
p get_cpa("Manuel Ugarte", 2158)
@tute
Copy link

tute commented Aug 2, 2011

Al final lo actualizaron y la interfaz web vuelve a ser fácil. Me di cuenta porque el código dejó de andar, bienvenida la renovación!

@norman
Copy link
Author

norman commented Aug 2, 2011

Excelente - en un mundo ideal no existirían estos gists. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment