Skip to content

Instantly share code, notes, and snippets.

@jnstq
Created January 1, 2009 19:02
Show Gist options
  • Save jnstq/42325 to your computer and use it in GitHub Desktop.
Save jnstq/42325 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'knock_knock'
require 'hpricot'
Bubble::KnockKnock::Connection.instance.connect('email','password', 'cp')
xml = Bubble::KnockKnock::Request.get('http://www.google.com/m8/feeds/contacts/username%40gmail.com/full', 'alt' => 'json')
doc = Hpricot::XML(xml)
(doc/:entry).each do |raw_item|
name = raw_item.at('title').inner_text
phone_item = raw_item.at("gd:phoneNumber[@rel='http://schemas.google.com/g/2005#mobile']")
phone = phone_item && phone_item.inner_text
puts "#{name} phone number is #{phone}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment