Ruby gem for Google SocialGraph released
01.02.08Filed Under: Ruby
Today, Google released their SocialGraph API. Since Tag Team’s core vision is to build cool stuff on the social graph, this is pretty exciting news.
We’ve cooked up a Ruby library to talk to the SocialGraph API, and get really interesting info out of it. This is the sort of thing that’s always more useful if more people have access to it, so even better, we’ve licensed it under the LGPL, so you can get all that Google goodness without having to do anything tedious to get it.
You can see the documentation if you’d like, or just enjoy the examples here:
require 'social_graph'
# We'll use Digg's Kevin Rose as our victim because hey, he's a pretty popular guy!
result = Google::SocialGraph.new "http://www.digg.com/users/kevinrose/"
# Get all people that Kevin refers to as a, acquaintance, contact, friend, or someone he's met
graph.refers_to_as([:acquaintance, :contact, :friend, :met]).inspect
# Now let’s get a list of all the people that say they’ve met Kevin
graph.referred_to_as(:met).inspect
# Anyone can say anything they want, but we want to know where else on the web we KNOW is Kevin.
# This looks for mutual links between sites to each other, with the given XFN identity.
graph.mutual_reference_as(:me).inspect
# We can also find people that Kevin is a friend with (and people who are friends with Kevin back!)
graph.mutual_reference_as([:friend, :met, :contact]).inspect
Get the source:
http://tagteaminteractive.com/code/social_graph/lib/social_graph.rb
Or, just get the gem!
gem install social_graph --source http://tagteaminteractive.com/code/
Hope it’s useful! If you end up using it, drop us a line and let us know how it’s being used.
3 Responses to “Ruby gem for Google SocialGraph released”
Leave a Reply
Subscribe to comments feed (this is global, not just for this entry)
Missouri Malpractice Lawyer…
just found your site. good stuff….
July 25th, 2008 at 7:58 pmGood Stuff….
Wasn’t looking for this but amazing what you can find online….
August 20th, 2008 at 6:15 amNice site….
Hey I wasn’t exactly looking for your site, but cool….
August 25th, 2008 at 11:26 pm