Garlenko

Description

Well, Garlenko is a gem that do what other gems are trying to do: Fetch contact information from Gmail, Hotmail/Live and Yahoo.

We are not using Oauth. Instead the basic username/password combo, because for our particular case, we need that, and Oauth doesn't play the way we need.

Why another contact gem?

Basically because most implementations doesn't work, or doesn't provide test/specs. Garlenko is not magic, or is the best implementation, but if you provide a valid spec/credentials.yml, you can run the tests and be sure that they work properly before doing all the plumbing of setting up your app.

How does it works?

Well... it depends.

For Gmail, we use gdata19. Simple, clean, although it uses roxml.

For Live, we use mechanize and nokogiri (tenderlove to the rescue). No simple API from the Microsoft guys, so we need to crawl it.

For Yahoo.... Just like Live, but with less scrapping.

How does it works?

Well... it depends.

For Gmail, we use gdata19. Simple, clean, although it uses roxml.

For Live, we use mechanize and nokogiri (tenderlove to the rescue). No simple API from the Microsoft guys.

For Yahoo.... Ooops, there is no Yahoo version yet. Soon, I hope.

How can I be sure Garlenko works?

Just copy spec/credentials.yml.example to spec/credentials.yml, do bundle install, and then bundle exec rspec spec.

cp spec/credentials.yml.example spec/credentials.yml
# edit file
bundle install
bundle exec rspec spec

NOTE: This step is only necessary to see if the current version still works with the Gmail, Yahoo, or Live from today.

Usage

This is a sample for Gmail, but feel free to change it for Live (if you want to retrieve Microsoft Live/Hotmail contacts):

client = Garlenko::Gmail.new("somemail@gmail.com", "use-alpha-and-alter-case-1999")
contacts = client.contacts
[
  {:name => "John", :email => "Doe" }
  #...
]

You can also get a client like this:

client = Garlenko.new(:gmail, "somemail@gmail.com", "use-alpha-and-alter-case-1999")

Hey, this piece of shit doesn't work!

Good to know.

Write a test, patch it, and send me a pull request. This a community driven project, so we are all resposable for this.

Help us keep it working.