There are some gems and plugin that can import contacts from different mail and social networks accounts. I was looking for a silver bullet. A plugin that can do it on gmail and also on hotmail accounts. The idea was to create a feature on my rails application where users could import their contacts to join my application.
I found blackbook, in order to install it correctly i have to install some gem dependencies:
- gem install mechanize (also need to install 'yum install libxslt-devel')
- gem install fastercsv
- gem install blackbook
Then hopefully everything works fine and i just need to use this line of code:
contacts = Blackbook.get :username => 'me@gmail.com', :password => 'whatever', :as => :xml
But unfortunately it not work :(
Then i search a little more and i found gem contacts from cardmagic. This gem has a importer to Gmail, Hotmail and also Yahoon account (who uses yahoo mail anyway).
The only thing i have to do is:
gem install contacts
Then in my code i can do:
Contacts.new(:hotmail, :email,:password).contacts
Contacts.new(:gmail, :email,:password).contacts
Contacts.new(:yahoo, :email,:password).contacts
This is very simple, but the gmail importer does not work. I discover that google has changed their API recently and now they use Auth authentication (We no longer need the password). So some guy found a fix to this problem and gem contacts now is working perfectly for gmail account (although still using email and password).
I found the fix in http://github.com/glennfu/contacts/tree/4e72b02b8c67b7b36083c8721a1d08c580068c0a
Sheers,
Hélder Loureiro
Wednesday, October 21, 2009
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment