Created
October 9, 2014 12:37
-
-
Save cobyism/3abf8a2615ccaf94b3c6 to your computer and use it in GitHub Desktop.
Started hacking on a BT DSL checker screen scraper thing
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
require 'rubygems' | |
require 'nokogiri' | |
require "net/http" | |
require "uri" | |
class DSLChecker | |
def check_phone_number(number) | |
params = { "TelNo" => number } | |
endpoint = URI.parse("http://www.dslchecker.bt.com/adsl/ADSLChecker.TelephoneNumberOutput") | |
response = Net::HTTP.post_form(endpoint, params) | |
html = Nokogiri::HTML(response.body) | |
# puts response.body | |
puts html.css("span.body span.body span.body").to_s.inspect | |
end | |
end | |
d = DSLChecker.new | |
d.check_phone_number("YOURNUMBERHERE") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you any update on this one ? or know of any other project looking at doing the same (PHP maybe ?)