I came across this tutorial on how to import contacts from Gmail, Yahoo or Hotmail.

The primary issue I encountered is that the gem doesn't work for Ruby 1.9. I use Ruby 1.9.2 for all of my Rails projects.

This might be useful for someone who's trying to get it to work. Just use my fork of the project on your Gemfile.

gem 'contacts', git: "[email protected]:katgironpe/contacts.git"

The gem uses gdata-19 which is pretty much a fork of the gdata project. I am aware there's already a gdata19 project but it doesn't quite work the way it expect it to. I still encountered some issues.

gem install gdata-19

This is now working for me:

Contacts::Gmail.new(gmail_email, gmail_password).contacts

And it's so fast!

Known Issues:

Security

HTTP authentication is less secure than OAuth.

Make sure you add something like this on your application.rb

    config.filter_parameters << [:gmail_email]
    config.filter_parameters << [:gmail_password]

We don't store data but there may be security issues. In fact, I don't use apps that use HTTP authentication. That isn't possible for e-commerce apps though. Developers still often store card number (and hopefully not the CVV though I have heard of some who do that!)

If anyone knows a gem or can create a gem for importing contacts from yahoo/gmail/hotmail and the gem supports OAuth, please let me know.

Thank you.

comments powered byDisqus

Hello! I am Kat. I've been a developer for several years. When I'm not sitting down, reading and working for long hours, I am traveling to some place of interest.
If you want to reach out, you can send me an email or add me up on Google Plus.