cardmagic / contacts

A universal interface to import email contacts from various providers including Yahoo, Gmail, Hotmail, AOL and Plaxo.
http://rubyforge.org/projects/contacts
BSD 3-Clause "New" or "Revised" License
618 stars 218 forks source link

Contacts::Yahoo does not work consistently #12

Open tribalvibes opened 14 years ago

tribalvibes commented 14 years ago

About 20% of the time it returns the contacts... 80% of the time it croaks with a protocol error. Apparently even when it returns data it has some parse errors (some emails dropped, some characters carried over to the next entry.) Testing with address books of several hundred contacts. Traces below.

Thanks for merging the gdata version of the GMail importer--it would be so great if someone could rewrite this importer (and all the others) to use the supported APIs from each provider where they exist rather than screen scraping which is destine to break continuously. Look how much less code the gdata call is than trying to parse the screen! Please consider this as a priority to any other development if this gem is to have any utility in the real world.

Trace:

c = provider.provider.new( u, p ).contacts()

Contacts::ConnectionError: #<Net::HTTPInternalServerError 500 Internal Server Error readbody=true>

"\n" from d:/dev/ruby/lib/ruby/gems/1.8/gems/contacts-1.2.1/lib/contacts/yahoo.rb:82:in contacts' from d:/dev/ruby/lib/ruby/gems/1.8/gems/contacts-1.2.1/lib/contacts/yahoo.rb:71:intimes' from d:/dev/ruby/lib/ruby/gems/1.8/gems/contacts-1.2.1/lib/contacts/yahoo.rb:71:in `contacts' from (irb):12 c = provider.provider.new( u, p ).contacts()

Contacts::ConnectionError: #<Net::HTTPInternalServerError 500 Internal Server Error readbody=true>

"\n" from d:/dev/ruby/lib/ruby/gems/1.8/gems/contacts-1.2.1/lib/contacts/yahoo.rb:62:in `contacts' from (irb):13

glennfu commented 14 years ago

I'm getting a similar issue lately, however it's throwing: raise AuthenticationError, "Username and password do not match" about 50% or more of the time, even if the password is right. I heard someone mention seeing a captcha, but I haven't seen one myself... perhaps on occasion now Yahoo is showing a captcha as you login?

glennfu commented 13 years ago

I've been able to reproduce this a little more frequently now. I find that if I connect to a Yahoo account with 500+ contacts, but don't retrieve the contacts, and then connect again soon afterward, the 2nd connection will fail with either an invalid password error, or sometimes a "this id has not been taken" error.