Facebook’s new real-time graph api

April 29, 2010

So after the f8 2010, Facebook opened up it’s new Apis. I started to tinker with the new Facebook Social Graph API.

Every object in the social graph has a unique ID. You can fetch the data associated with an object by fetching https://graph.facebook.com/ID.

Facebook also updated their policies to allow caching of their data to reduce API hits to their system. Kind of makes sense as people were probably storing data anyways, and reduces their server loads. A new service they now offer are Real-time Graph subscriptions. This service allows you to subscribe to graph objects and in near real-time ( approx 1 min or less ) your calllbacks get pinged when data changes in their graph. It’s pretty cool and I have setup a basic prototype for testing.

To make this work I had to do a few things.

  1. I turned on error_log in my php.ini, so I had a place to capture the callback and follow the real-time updates
  2. I also had to install the pecl_http extension.
  3. pecl install pecl_http
  4. on Ubuntu I needed to do sudo apt-get install libcurl4-openssl-dev first
  5. add extension=http.so to /etc/php5/apache2/php.ini
  6. restart apache
  7. checked phpinfo()

My basic proto is working :), next I will be integrating for use in our game

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: