From 9fc025215766b6c02859d9006d563b5d9ff88b8f Mon Sep 17 00:00:00 2001 From: Lucas Carlson Date: Tue, 26 Jan 2010 10:52:56 -0800 Subject: [PATCH] Update to handle google captcha better, thanks justintv. Bump to v1.2.3 --- README | 7 +++++++ contacts.gemspec | 2 +- lib/contacts/base.rb | 8 ++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README b/README index f9e80da..9b429f0 100644 --- a/README +++ b/README @@ -26,6 +26,12 @@ For a long time, the only way to get a list of contacts from your free online em Notice there are three ways to use this library so that you can limit the use as much as you would like in your particular application. The Contacts.guess method will automatically concatenate all the address book contacts from each of the successful logins in the case that a username password works across multiple services. +== Captcha error + +If there are too many failed attempts with the gmail login info, Google will raise a captcha response. To integrate the captcha handling, pass in the token and response via: + + Contacts::Gmail.new(login, password, :captcha_token => params[:captcha_token], :captcha_response => params[:captcha_response]).contacts + == Examples See the examples/ directory. @@ -45,6 +51,7 @@ See the examples/ directory. * Glenn Ford (mailto:glenn@glennfu.com) - http://www.glennfu.com/ * Leonardo Wong (mailto:mac@boy.name) * Rusty Burchfield +* justintv This library is released under the terms of the BSD. diff --git a/contacts.gemspec b/contacts.gemspec index 599297d..4a7e875 100644 --- a/contacts.gemspec +++ b/contacts.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "contacts" - s.version = "1.2.2" + s.version = "1.2.3" s.date = "2010-01-20" s.summary = "A universal interface to grab contact list information from various providers including Yahoo, AOL, Gmail, Hotmail, and Plaxo." s.email = "lucas@rufy.com" diff --git a/lib/contacts/base.rb b/lib/contacts/base.rb index 761db16..0b877f4 100644 --- a/lib/contacts/base.rb +++ b/lib/contacts/base.rb @@ -9,14 +9,14 @@ class Contacts TYPES = {} - VERSION = "1.2.2" + VERSION = "1.2.3" class Base - def initialize(login, password, captcha_token=nil, captcha_response=nil) + def initialize(login, password, options={}) @login = login @password = password - @captcha_token = captcha_token - @captcha_response = captcha_response + @captcha_token = options[:captcha_token] + @captcha_response = options[:captcha_response] @connections = {} connect end