Announce: New Portable Contacts gem for Ruby

38 views
Skip to first unread message

Pelle

unread,
Oct 2, 2009, 3:50:34 PM10/2/09
to PortableContacts
I have written a OAuth/JSON only client library for Ruby. It certainly
needs more work, but should be fine for simple use as it is.

Example code:

@access_token = ... # instantiate access token

@client = PortableContacts::Client.new "http://www-
opensocial.googleusercontent.com/api/people", @access_token

# Get users profile

@profile = @client.me

puts @profile.display_name
=> "Bob Sample"

# Get users contacts
@contacts = @client.all


Source code is here:
http://github.com/pelle/portablecontacts

Documentation is here:
http://rdoc.info/projects/pelle/portablecontacts/

To install it just do:

sudo gem install portablecontacts

It was designed to be used with the OAuth Ruby gem. But if you're a
rails developer use the OAuth Plugin which hides a lot of the
complexity of OAuth:

http://stakeventures.com/articles/2009/07/21/consuming-oauth-intelligently-in-rails

Over the next day or so I will add support for this gem to the OAuth
plugin.

Next step for me is to do a simple xrds library that will glue all of
this together.

P

Joseph Smarr

unread,
Oct 3, 2009, 12:17:48 PM10/3/09
to portable...@googlegroups.com
This is awesome, thanks!! :) js
Reply all
Reply to author
Forward
0 new messages