2 @@AUTHENTICATION_URIS = {
3 :verify => '/account/verify_credentials',
6 # Provides access to the Twitter verify credentials API.
8 # You can verify Twitter user credentials with minimal overhead using this method.
11 # client.authenticate?("osxisforlightweights", "l30p@rd_s^cks!")
12 def authenticate?(login, password)
13 verify_credentials(login, password)
17 def verify_credentials(username, passwd)
18 connection = create_http_connection
19 connection.start do |connection|
20 request = create_http_get_request("#{@@AUTHENTICATION_URIS[:verify]}.json")
21 request.basic_auth(username, passwd)
22 response = connection.request(request)
23 response.is_a?(Net::HTTPSuccess) ? true : false