First Look: Publishing Data to the Facebook Stream Using the New Stream APIs
There were two sides to the stream APIs that Facebook released yesterday: getting data, which we’ve looked at, and publishing and updating. The latter has the potential to really open up Facebook to external sites, and although it’s only available to application developers at the moment it’s worth taking a look at how it works.
Trying to entice a user to give you permission to update their stream via your application or Connect site is as simple as it is for reading: there’s a simple piece of FBML which can be presented as a text link, button or other HTML element that prompts the user to grant an extended permission:
<fb:prompt-permission perms=”publish_stream”>Grant permission to publish to my stream</fb:prompt-permission>
Clicking on this brings up a similar dialogue to the one that granted permission to read but with the direction arrows representing the flow of information reversed to indicate information will be flowing from the application:
As before, this is fairly clear and shouldn’t cause too many users to turn back at this point (assuming this permission is something that they want to give). The proportion of users that will be happy to grant this permission will obviously depend on the application in question. As always, there’s a value exchange and users are unlikely to grant access without concrete benefits.
Should there be wide-scale misuses by applications, as there have been with other Facebook Platform features, then there’s also the danger that permission granting will be controlled by users as much as story publishing is currently – i.e. they’ll refuse/disable it wherever they can. It’s up to developers to make sure the power it provides is used to add value to the Facebook experience and isn’t discredited through abuse.
The ideal end-game for developers will be that the permission is granted by default as part of initially authorizing an application. Although this is unlikely to happen to this degree it will be interesting to see if valid uses of the feature prompt Facebook to raise its prominence e.g. by making it an up-front, but still opt-in, option when authorizing an application.
Once a user has granted permission the level of control available over the stream is quite powerful. Facebook provides a number of key interaction points:
- Publish to the stream. This is very much the same as the current stories that appear when a user chooses to publish from within an application. This is equivalent to the user granting permanent permission to publish feed stories so in itself is not a new interaction point.
- Remove items from the stream. Users can control of their own stream by removing items that they themselves have published, but only with the application they’re currently using. These will then disappear from both their own and their friends news feeds. The limitation to the calling application may restrict the usefulness of this call.
- Add comments to existing items. This is done by retrieving a unique ID for each post in the stream and simply making an API call with the comment and the post’s ID. It appears instantly in the owner’s stream, whether it’s the original user’s or one of their friends or even a Facebook Page
- “Like” existing stream items. As above, this is just the same as if the user had performed the action directly and inserts a “like” next to any specified item in the stream
- Remove comments and likes. Only the user’s own comments and likes can be removed, for obvious reasons.
The stream publishing API is one of the more powerful features that Facebook has released since the start of the platform. It will be interesting to see whether users grant applications with the permission that’s required to make use of it, and whether new and innovative uses beyond simple re-styling of the stream or porting to an external website (which are obvious first steps) start to appear.
While the publish feature is still in beta, there’s no date on when it will be generally available beyond a note on the Wiki stating “This method will be available soon.” More technical information can be found on publishing to the stream can be found on the Facebook Developer’s Wiki.