How to Programmatically Administer Off-Facebook Pages with the Open Graph API

With the Open Graph protocol that Facebook announced at last week’s f8 conference, any URL can now be treated just like a Facebook Page. After you mark up your site with the right metadata and encourage users to start Liking your site, you can then publish updates to their Facebook News Feed just like as if your website were an on-Facebook.com Page.

But a good question is: exactly how does a website publish to the Facebook News Feed when it doesn’t exist as a Facebook Page in the first place? Well, the answer is two-fold:

1) First, Facebook said last week that all websites that mark themselves up with the right Open Graph metadata and <fb:admins> tag will actually get an admin interface just like that of Facebook Pages, from which they can publish status updates to fans. At that point, you’d simply have to head over to Facebook to publish status updates.

2) Second, Facebook has also made available a way to associate your Open Graph-enabled site with a Facebook application. By adding the following line to your pages, Facebook will connect your site to an application ID:

<meta property="fb:app_id" content="1234567"/>

Then you’ll need to get the Facebook ID for your page from its canonical URL:

Once you have that ID for your URL, you can publish to users’ streams programmatically using the stream.publish API (though Facebook says a new method is coming “very shortly”).

Ultimately, Facebook hopes that by getting a lot of sites to adopt the Open Graph protocol, it can drive more engagement for publishers by getting them to adopt the News Feed as a more important form of user communication. If it succeeds, Facebook would then become an even more important layer of communications infrastructure as it serves more sites around the web in the same way that it has traditionally just served “Pages” on Facebook.com.