Skip to content

This ruby gem will serve as an interface to Rapleaf's person and graph apis. Note that this library is not maintained by or affiliated with Rapleaf in any way and you will still need a (free) api key from Rapleaf to use this.

acoffman/rapleaf_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rapleaf_api

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

Getting Started

You need to first get an API key found here:

http://www.rapleaf.com/developer/

Installation

sudo gem install rapleaf_api

Usage

require 'rubygems'
require 'rapleaf_api'

rapAPI = RapleafApi::Api.new("your api key")

Person API

#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"}})

Graph API

#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.

Authors

Special Thanks

Dave Paola - Pointing out a bug in the sample code

About

This ruby gem will serve as an interface to Rapleaf's person and graph apis. Note that this library is not maintained by or affiliated with Rapleaf in any way and you will still need a (free) api key from Rapleaf to use this.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages