Friday, October 8, 2010

Dell Zino HD Windows Experience Index

Processor: 5.2
RAM: 5.9
Graphics: 3.6
Gaming Graphics: 5.2
Primary Hard Disk: 5.9

Wednesday, October 6, 2010

Posting to a Facebook Page

Just spent 6 hours with the new Facebook Graph API to figure out how to post to a Facebook Page.

Firstly, you need to register an app to get the App ID and Secret Key
(the basic app registration process is dead simple now. 2 textboxes, a drop down list and a submit button!)

This is for the portion that says "This is my status update - 6 minutes ago via Your App Name"

On the developer's end, you need to do 2 things:

1 - Provide a link for the user to click to log in to Facebook / authorize your app with the relevant permissions
a) Facebook Authorization Docs: http://developers.facebook.com/docs/authentication/
b) Extended Permissions: http://developers.facebook.com/docs/authentication/permissions/

2 - Provide a page for Facebook to return to once the User has logged in / authorized your app
a) Facebook will return the access token (code) that the developer can use to manipulate user data

Extended Permissions
==================
Seems that the 2 minimum extended permissions you will need are publish_stream and manage_pages. This should come under the "scope" querystring when doing the Authentication link, as mentioned above.

Get the authenticated User's accounts details
Note that "Accounts" refers to the Pages that the User administers
"https://graph.facebook.com/me/accounts?access_token=" + strAccessToken

Account details will return Page ID, Name, and Page Token

Note that the Page Token is different from the User's Token in the sense that if you POST something to Facebook using the User's token, the User will be reflected as the one contributing the POST. Example, "Muhammad Yussuf posted an update".

When you use the Page Token, it will look like this instead: "[Page Name] posted an update"

Publishing to Facebook Reference:

Facebook User Setup
====================
The only requirement to this is that the User must be the Owner / Creator of the Page to impersonate it. That means, the average Facebook user does not have any data under the "accounts" API call.

Other Notes:
=====================
The Facebook Graph API returns JSON only. So it's a bit of a headache to integrate with C#. Google for JSON.NET at CodePlex