19
Facebook Open Graph Protocol and Graph API NoVA Code Camp 2010.1

Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)

Embed Size (px)

Citation preview

Facebook Open Graph Protocol and Graph API

NoVA Code Camp 2010.1

Chris Busse

• Partner & Manager of Technology, Fahrenheit Emerging Media

• http://Twitter.com/busse• http://www.chrisbusse.com• [email protected]

Facebook Development, in general• April 2010: Graph API released• The “walled garden” is a bit more open now, this is a more

semantic web• Privacy concerns are running wild in the media• ….With good reason, Facebook is catering to businesses and ad

dollars• It’s like working with a team of other developers who you can’t

see, can’t communicate with, and who don’t do QA

“There is no real Facebook dev documentation. Anything that appears to be documentation should actually be labeled ‘Clues’”

- My co-worker

Facebook APIs• Core APIs

– Graph API– Social plugins

• Facebook SDKs– JavaScript SDK– PHP SDK– Pythod SDK– iPhone SDK– Android SDK

• Advanced APIs– Facebook Query Language (FQL)– Facebook Markup Language– Old REST API– Old JavaScript Client Library

Facebook APIs• Core APIs

– Graph API– Social plugins

• Facebook SDKs– JavaScript SDK– PHP SDK– Pythod SDK– iPhone SDK– Android SDK

• Advanced APIs– Facebook Query Language (FQL)– Facebook Markup Language– Old REST API– Old JavaScript Client Library

Part I:Graph API

Discovering what’s out there on Facebook

Graph API• Exposes Objects in the Facebook Social Graph via JSON

AlbumEventGroupLinkNotePagePhotoPostStatus messageUserVideo

• Also enables Graph-wide searching

Properties & Connections: User

PropertiesidFirst_name,

Last_nameNameLinkAboutBirthdayWork, EducationEmail, WebsiteLocationGenderInterested_inMeeting_forRelationship_statusReligion, PoliticalSignificant_othertimezone

ConnectionsFeedTaggedPostsPictureFriendsActivitiesInterestsMusic, Books, Movies,

TelevisionLikesPhotosStatuses

Introspection of Objects

Other Graph API Operations

• Publishing to Facebook:FeedCommentsLikesNotesLinksEventsPhotos

• Deleting Objects• Analytics

Demo

• ASP.NET• JSON.NET

Part II: JavaScript SDK

Creating objects in the Social Graph

or, Microformats for your Levi’s 501 button-flys

Open Graph Protocolhttp://opengraphprotocol.org/

• Enables any web page to become an object in a social graph• Used by Facebook to enable any web page to have the

same functionality as a Facebook Page• Four required properties for every page:

og:titleog:typeog:imageog: url

• Optional, but recommended:og:descriptionog:site_name

Open Graph Protocol: Types• Activities• activity• sport• Businesses• bar• company• cafe• hotel• restaurant• Groups• cause• sports_league• sports_team• Organizations• band• government• non_profit• school• University

• People• actor• athlete• author• director• musician• politician• public_figure• Places• city• country• landmark• state_province• Products and Entertainment• album• book• drink• food• game• movie• product• song• tv_show• Websites• article• blog• website

Examples, Object

Facebook is now aware of your object

• Object is similar to a Page in Facebook, but exists on your site

• Enables future messaging “by” the object“When publishing, use only the 'voice' of the object.

For example, if users are liking an actor in a TV show, that actor should publish stories about themselves, not general information on the show, or the TV network.”

ResourcesGraph API: http://developers.facebook.com/docs/api

FB Open Graph Protocol:http://developers.facebook.com/docs/opengraph

JSON.NET: http://json.codeplex.com/

ASP.NET example of site authentication:http://www.mattcashatt.com/readArticle.aspx?id=360d779e-dd83-431a-8bdb-e3002dae5eee

• http://Twitter.com/busse• http://www.chrisbusse.com• [email protected]