Skip to content

Instantly share code, notes, and snippets.

@cobyism
Created October 9, 2014 12:37
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 cobyism/3abf8a2615ccaf94b3c6 to your computer and use it in GitHub Desktop.
Save cobyism/3abf8a2615ccaf94b3c6 to your computer and use it in GitHub Desktop.
Started hacking on a BT DSL checker screen scraper thing
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")
@g3raint
Copy link

g3raint commented Oct 7, 2016

Have you any update on this one ? or know of any other project looking at doing the same (PHP maybe ?)

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