Intridea Development Blog

Beboist - A Rails Plugin for the Bebo Social API

UPDATE

Click here for the latest on Beboist


The Beboist plugin provides a Rails interface to the Bebo Social Networking API.

The plugin was designed from the ground-up to be flexible enough to accommodate any changes to the API, while at the same time providing a clean interface that will be familiar to most Rails developers.

Setup

Ensure that the json gem is installed on your system and the Beboist plugin is installed in your vendor/plugins folder:

gem install json
script/plugin install http://svn.intridea.com/svn/public/beboist

Generate your config/bebo.yml file using

<code>script/generate beboist_settings</pre>

Fill in your appropriate app settings in <code>config/bebo.yml</code>. Ensure that your app name is right.

Generate the first migration for your users table using: <pre><code>script/generate beboist_user_migration</pre>

Migrate your database using <pre><code>rake db:migrate</pre>

In your application.rb, insert the following filters: <pre><code>before_filter :reject_unadded_users
before_filter :find_bebo_user</pre>

Write your app, and keep an eye on your logs to catch any possible error messages.

h3. API Reference

The methods listed in the "Bebo API Documentation":http://www.bebo.com/docs/api/Default.jsp are mapped to Ruby classes in the following manner:

<pre name="code" class="ruby">users.get_info(uids => "1,2,3", fields => "first_name, last_name")
  # BECOMES
BeboUsers.get_info :uids => [1,2,3], :fields => ["first_name", "last_name"]</pre>

h3. Notes

The Beboist plugin uses Bebo's JSON API, and the 'json' gem to directly convert JSON objects to Ruby. It works with Rails 2.0+, but has not been tested on Rails 1.2. Check the "README":http://svn.intridea.com/svn/public/beboist/README for more details, and file tickets at "Intridea's Public Trac":http://trac.intridea.com/trac/public

Blogs: Company, Development Comment | 
blog comments powered by Disqus