Created
July 21, 2011 15:25
-
-
Save stevedev/1097432 to your computer and use it in GitHub Desktop.
Revisions
-
stevedev revised this gist
Jul 21, 2011 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,12 @@ There are basically two ways to get authorization and how you use them depend on 1. If you are making an app for a Page, that only needs access to that Page's information, you just need the appId and secret. 2. To access a user's page you have to first get their permission using oAuth. PHP's SDK makes that pretty simple. This is what you need to do to post to their wall, access their photos, get a list of their friends, update their status, etc. ### Real time updates If you store user information on your site, or you want to have your site/app react when something changes on one of your users' accounts, you can use the Real-time Updates. Basically, you subscribe to what you want sent to you, setup a callback handling script, and then figure out what you want to do with it on your site/app. <http://developers.facebook.com/docs/reference/api/realtime/> ## PHP SDK - Github: <https://github.com/facebook/php-sdk> -
stevedev revised this gist
Jul 21, 2011 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -54,6 +54,12 @@ Dialogs let you use Facebook to post to walls on your site, without any programm View more here: <http://developers.facebook.com/docs/reference/dialogs/> ## Social Channels These are just Javascript SDK based methods that you can use to publish content back to Facebook. Includes a post to my wall dialog, an invite your friends dialog, a like button. <http://developers.facebook.com/docs/channels/> ## Opengraph These are meta tags that you can embed in the <head> of your html that explicitly provide information about the page content to Facebook. You'd use these, for example, if you had a page about a photo and you wanted to provide a thumbnail to Facebook and a description. -
stevedev revised this gist
Jul 21, 2011 . 1 changed file with 16 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,9 +26,9 @@ There are basically two ways to get authorization and how you use them depend on ## PHP SDK - Github: <https://github.com/facebook/php-sdk> - Example: <https://github.com/facebook/php-sdk/blob/master/examples/example.php> - Great tutorial: <http://thinkdiff.net/facebook-connect/php-sdk-3-0-graph-api-base-facebook-connect-tutorial/> To push data back to facebook (if you have the correct permissions from the user): @@ -40,6 +40,19 @@ $data = array( $facebook->api('/steve.thompson/feed', 'post', $data); </pre> ## FQL You can use FQL to do more efficient and advanced queries, as well as gain access to information that you cannot get through the Graph API. Here is a great slideshow on FQL: <http://www.slideshare.net/csaila/fql-overview> <http://developers.facebook.com/docs/reference/fql/> ## Dialogs Dialogs let you use Facebook to post to walls on your site, without any programming. For example, you could pop open a window and direct it to <http://www.facebook.com/dialog/feed?app_id=123050457758183&redirect_uri=http://www.example.com/response/&display=popup> and then you'd have an instant Post to My Wall Dialog. View more here: <http://developers.facebook.com/docs/reference/dialogs/> ## Opengraph -
stevedev revised this gist
Jul 21, 2011 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,10 +34,10 @@ To push data back to facebook (if you have the correct permissions from the user <pre> $data = array( 'message' => 'Postin to my wall' ); $facebook->api('/steve.thompson/feed', 'post', $data); </pre> -
stevedev created this gist
Jul 21, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,63 @@ # Facebook Cheatsheet ## Graph API The Graph API is Facebook's RESTful API for interacting with data from User's, Application's and Company's "social graph" or information. Some calls require authorization and some do not. Reference: <http://developers.facebook.com/docs/reference/api/> Explorer tool: <http://developers.facebook.com/tools/explorer/?method=GET&path=621042512> ### Public Information Public information is available without authorization. Basic information about a user, for example: <https://graph.facebook.com/steve.thompson> You can get quite a bit more information from a page, versus a user: - <http://graph.facebook.com/109119012459216> - <http://graph.facebook.com/109119012459216/photos> - <http://graph.facebook.com/109119012459216/albums> ### Private Information There are basically two ways to get authorization and how you use them depend on what information you are requesting: 1. If you are making an app for a Page, that only needs access to that Page's information, you just need the appId and secret. 2. To access a user's page you have to first get their permission using oAuth. PHP's SDK makes that pretty simple. This is what you need to do to post to their wall, access their photos, get a list of their friends, update their status, etc. ## PHP SDK Github: <https://github.com/facebook/php-sdk> Example: <https://github.com/facebook/php-sdk/blob/master/examples/example.php> To push data back to facebook (if you have the correct permissions from the user): <pre> $data = array( 'message' => 'Just updatin my status' ); $facebook->api('/steve.thompson/status', 'post', $data); </pre> ## Opengraph These are meta tags that you can embed in the <head> of your html that explicitly provide information about the page content to Facebook. You'd use these, for example, if you had a page about a photo and you wanted to provide a thumbnail to Facebook and a description. You can view how Facebook analyzes a page by going here: <http://developers.facebook.com/tools/lint/> ## Javascript SDK I personally despise this SDK and have found it very frustrating to use in combination with the PHP-SDK. Either use one or the other. ## Using Facebook for Authentication on your site <http://developers.facebook.com/docs/guides/web/#login> ## Other links - Facebook Developer app (to create new apps): <https://developers.facebook.com/apps> - Facebook status: <http://developers.facebook.com/live_status> - Test users: <http://developers.facebook.com/docs/test_users/> - Access Token Generator for testing: <https://developers.facebook.com/tools/access_token/>