social graph api Archives - Stay N Alive

Google: You Have the Same Thing as Facebook – Why Not Promote It?

Google is sitting on a gold mine opportunity right now and all I hear is complaining from their employees.  Matt Cutts Deactivated his Facebook account and Tweeted about it to tell the story.  Chris Messina called Facebook the dreaded “evil” word, and criticized the idea for being decentralized.  Frankly, I’m getting tired of it and it’s making Google look desperate.  Instead, here’s what I’d rather see Google doing:

Promote the Heck Out of Google Social Graph API

I don’t get it – Google employees are criticizing Facebook for not being decentralized when Facebook did just that.  With the OpenGraph Protocol, any platform on the web can now implement a similar Pages network and integrate with the network of Pages Facebook is bringing into its own network. The opportunity is open to all, not just Facebook.  Facebook even went to the extent of releasing that protocol under the Open Web Foundation agreement, solidifying that they were okay with others copying it.

Google has been promoting something similar – XFN links and FOAF attachments (along with “me” relationship identifiers to identify an individual as the same person across the web).  In fact, Google built an API around it so others can have access to these protocols.  Guess what?  Facebook has an API as well for the OpenGraph protocol (called, quite similar “Graph API”).  Has Google opened up their Social Graph API? No. (meaning, not any other network can copy the protocol of the API and use it as their platform as well)  Neither has Facebook.  There’s nothing wrong with that – they have to compete.

Google has a huge opportunity right now to be riding the coattails of Facebook on this announcement by promoting its SocialGraph API and how it’s a little better for the web than what Facebook is doing with its API around the OpenGraph.  Rather than complain about what Facebook is doing, why not take the positive route and push that you have something better?  Google has an incredible opportunity here to finally make the SocialGraph API really big, and they’re squashing it by spending their energy canceling their Facebook accounts and criticizing their efforts publicly.  I think it’s totally the wrong move for Google to be making right now.  Their PR department needs to get ahold of their employees and formulate a strategy for response.

Promote the Heck Out of Google Friend Connect

On top of the APIs and OpenGraph or SocialGraph related protocols (again, emphasis on the protocol being the open part of both networks – none of the other stuff, on both Google and Facebook’s side is), all that was launched by Facebook on Wednesday was a series of Widgets that lie on top of all this to make implementation of everything very easy.  Google has the same thing, yet I have not heard one peep from Google employees about it since then.

Google’s product is called Friend Connect.  Look at the Friend Connect page of widgets here and then look at the OpenGraph Social Plugins page here and tell me how they differ?  The main difference is Google actually has more widgets than Facebook does.  Kevin Marks, former Google employee who initiated OpenSocial and the Friend Connect program at Google, was quick to point out to me on Twitter that even Friend Connect has a like button (you can see it on his iPad Knees Up site in the upper-right here), and it requires a Google login to use!  How is that any different than what Facebook is offering?  You can see an example of Friend Connect in action over to the right where you see everyone’s profile pictures (note you didn’t even have to log in to see those, and there is no opt-out).

This is Google’s time to shine – show businesses that they can promote Twitter users and iGoogle users and Buzz users and Orkut users, and provide all the same functionality Facebook is providing, just as easy as they are (with the exception of that extremely simple Graph API Facebook just launched).  Come up with new features that compete where you’re not at their level yet.  The world doesn’t know about this yet.  Google has more people using its network than Facebook does – Google needs to flaunt this, not complain.

Start Building on Facebook’s OpenGraph API and Stop Complaining

I’m sure I’ll get plenty of complaining responses by Google employees and former Google employees from this, but, I really hope they take this to heart and rather than argue with me on this, just go out and promote the products that they have.  They potentially have something even bigger than what Facebook has, and it’s extremely important that the world knows about this.

Google really should consider taking advantage of this new protocol by Facebook – integrate it on its own sites, just as it expects Facebook to do with FOAF and XFN.  Find ways to search and index this data in ways that Facebook just doesn’t have the advantage.  They should find ways to integrate Facebook login (it’s just OAuth 2.0 now!) into their Friend Connect login process – Facebook’s being completely open in this.

I’ve been arguing on Twitter with Kevin Marks about Google’s past attempts to integrate Facebook Connect into Friend Connect.  They were denied, because they were displaying user data without user permission before.  He referred to this page in the Terms of Use for Facebook.  The thing is, Facebook has provided means around this problem.  Facebook is all about user privacy, even down to the developers that integrate their platform.  Google got shut down because they weren’t using the means Facebook set out to use their data.  There is a specific permissions API Facebook released within a month after Google launched Facebook support in Friend Connect (and got shut down), just to solve Google’s problem and Google never used it.

It’s time Google start accepting these Facebook social graphs.  Let us bring our Facebook friends into Google’s network – there’s not even a storage limit any more!  Google needs to start playing nice or they’re going to get left in the dust.  It’s time to stop complaining and take the ball back into your own court, Google.  Otherwise I’m going to have no choice but to abandon Google products and go where my real friends are playing.  That’s not a threat – it’s just the reality of where I’m being forced to go.

Social Coding Series: I’m In Your Social Graph, Hacking Your Life – a Howto

As the first entry to my Social Coding series I’m going to cover Google’s Social Graph API. I saw a demo of this at Google I/O in San Francisco and was so impressed that I immediately started hacking on it when I got home. Little did I know how powerful this API was and how much information it could pull off the web about a single individual!

Google’s Social Graph API takes a cache of the rich storage of links, information, and URLs on Google’s servers, and determines which of those contain information about actual people. It combines OpenID for confirming an individual’s identity, and XFN and FOAF XML protocols to determine links between those identities. With a simple tag on a user’s website, a user can determine other websites that also identify them. If you link to one URL identifying that location as you, and at the linked website, it links back to you, Google can tell for sure both of those websites are yours, and identify you as a person. Not only that, but you can similarly provide XFN information or FOAF information via similar tags or a separately linked file identifying who your friends are. If they link back to you via similar metadata Google can tell for sure that the two of you are friends.

The Social Graph API lives and breaths this data. There are actually quite a few Social networks that use this protocol to identify you and your friends. Sites like Digg, Twitter, and FriendFeed all utilize these protocols to identify your friends. The Google Social Graph API scans this data and organizes it in an easy way for you, as a developer, to access.

Let’s try a simple example, and you don’t even have to be a developer to try it. Google has provided a simple playground to see how the Social Graph API works. If you go to http://socialgraph-resources.googlecode.com/svn/trunk/samples/exploreapi.html, enter in a few URLs of your blogs, social networking profiles, and other identifying locations on the web, leave “Follow ‘me’ Links”, “Pretty Output” checked, and click, “Find connections”. For me, just “twitter.com/jessestay” was all I needed to enter in the textarea.

The resulting structure is organized in a format called JSON – if you’re a Perl developer you might be familiar with this, as it is formatted the same way as a Perl Hash structure. You’ll see under “nodes” a bunch of URLs with different metadata about the URL – these are URLs that Google thinks, based on the metadata in the URL you provided, are you or contain info about you. I’ve found that only those with a “profile” attribute are actual Social Network profiles for yourself, so be sure to pay attention to those.

You can also go back and click “show inbound links” and “show outbound links” – this will then return URLs with links to sites you have identified as yourself, as well as sites you own that claim other sites as identifying for you. Play around with it – there’s a wealth of information it will give you about people!

Now, if you’re not a developer, you can skip over this next section because I’m going to get technical by showing an example. I’m a Perl developer so I’ll show one in Perl.

In Perl it’s simple – you need to install Net::SocialGraph with a command similar to this:

perl -MCPAN -e “install Net::SocialGraph”

Then, a bit of code like this will give you the data you need:

my $sg = Net::SocialGraph->new(‘fme’ => 1);

my @urls = ();
push (@urls,’http://twitter.com/jessestay’);
push (@urls,’http://facebook.com/profile.php?id=683545112′);

my $res = $sg->get(@urls);
my @profiles = ();
foreach my $node (keys %{$res->{‘nodes’}}) {
  if ($res->{‘nodes’}->{$node}->{‘attributes’}->{‘profile’}) {
    push (@profiles, $res->{‘nodes’}->{$node}->{‘attributes’}->{‘profile’});
  }
}

In the above example I instanciate my $sg object, telling it to follow “me” attributes in the response. I add a couple URLs to identify the individual I want profile information for (in this case, me), and then make the call to the SocialGraph API to go get my info based on those URLs with the “get” method provided by the API. Then, I just traverse the response and I can do whatever I want with it. After this, I could take the response information and list all of the user’s profiles as links, or perhaps I could scan those profiles for more information and provide information about each identified profile. You’ll also note that it’s not always correct so you’ll want to let the user intervene. Also, note I’m looking for only links with a “profile” attribute – I’ve found these to be most accurate.

Beyond that, that’s it. Ideally, you could take the Playground example above and look at the resulting URL. The basics of the Social Graph API are just that URL – plug in whatever you want and you’ll get back whatever information you need. You could then parse it with Javascript, Perl, PHP, or just leave it in the “pretty” format the Playground provides you by default.

Now, imagine taking that data and combining it with, say the Twitter API to pull out all of an individual’s friends on Twitter, then applying the Social Graph API to each of those individuals. Soon, you have a tool which can identify which of a user’s friends are on which networks, and if there are any of your friends you have not yet added on those networks. This API is powerful!

The Social Graph API can be an excellent utility to find out more information about any individual using your applications. No longer do you have to ask the individual for that information – so long as they are active on Web 2.0 that information can be provided for them to choose from!

You can learn more about the Social Graph API here.

Please note I too am new to this API – any inaccuracies in this document please let me know in the comments and I will correct them for others to benefit.