NOTE: The Rapleaf API has changed versions and formats since this gem was created. I am going to leave it up here for reference but for production code you should look for Rapleaf's officially maintained repository Personalization-Dev-Kits
You need to first get an API key found here:
http://www.rapleaf.com/developer/
sudo gem install rapleaf_api
require 'rubygems'
require 'rapleaf_api'
rapAPI = RapleafApi::Api.new("your api key")
#by email
person = rapAPI.query({:type => :person, :opts => {:email => "email"}})
#by md5 hash of email
person = rapAPI.query({:type => :person, :opts => {:hash => RapleafApi::MD5, :id => "md5 hash of email"}})
#by site id
person = rapAPI.query({:type => :person, :opts => {:site => RapleafApi::TWITTER, :id => "twitter username"}})
#by email (note this query will only work if you have an email set stored with Rapleaf)
friendList = rapAPI.query({:type => :graph, :opts => {:id => "email address"}})
#by email, return Rapleaf IDs instead of scoped emails
friendList = rapAPI.query({:type => :graph, :opts => {:id => "email address", :return_rapid => true}})
#by Rapleaf ID, this will return a list of Rapleaf IDs
friendList = rapAPI.query({:type => :graph, :opts => {:id => "rapleaf id", :by_rapid => true}})
More Advanced Examples :: Combine the APIs for interesting results.
- Adam Coffman :: coffman.adam@gmail.com
- Brent Beer :: brentbeer@gmail.com
- Mark Sands :: marksands07@gmail.com
Dave Paola - Pointing out a bug in the sample code