Facebook Application Development with Graph API Cookbook

Facebook Application Development with Graph API Cookbook
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Dive headfirst into Facebook application development with the all new Facebook Graph API.
  • Packed with many demonstrations on how to use Facebook PHP and JS SDKs.
  • Step by step examples demonstrating common scenarios and problems encountered during Facebook Application Development.
  • Houses an exquisite collection of ready to use Facebook applications.


Book Details

Language : English
Paperback : 350 pages [ 235mm x 191mm ]
Release Date : November 2011
ISBN : 1849690928
ISBN 13 : 9781849690928
Author(s) : Shashwat Srivastava, Apeksha Singh
Topics and Technologies : All Books, Networking and Servers, Cookbooks, PHP, Web Development

Table of Contents

Chapter 1: Creating a New Facebook Application
Chapter 2: Be a part of Social Graph
Chapter 3: Querying Facebook
Chapter 4: Using FB Script
Chapter 5: Expressing Yourself
Chapter 6: Bringing Facebook to your Website
Chapter 7: Connecting Websites to the Social Graph
Chapter 8: Fiddling with Virtual Currency
Chapter 9: Creating Advertisements and Analyzing Metric Data
Chapter 10: Creating Instant Applications
Chapter 11: Using Facebook Open Graph Beta
  • Chapter 1: Creating a New Facebook Application
    • Introduction
    • Downloading PHP-SDK and setting up your environment
    • Registering a new Facebook application
    • Configuring a Facebook application
    • Getting authorization and a valid session for the user
    • Requesting specific permissions from the user
    • Logging out a user
    • Handling navigation in an iFrame Facebook application
    • Handling form submission in an iFrame Facebook application
    • Dynamically resizing an iFrame Facebook application
    • Determining whether a Facebook page has been liked by a user
    • Chapter 2: Be a part of Social Graph
      • Introduction
      • Retrieving a user's information
      • Liking a post
      • Commenting on a given post
      • Setting status message
      • Deleting a picture, post, or comment of a user
      • Retrieving the current user's friendlist
      • Creating a post on the wall of a user's friend
      • Posting a picture to a specific album of the user
      • Retrieving the names of the user's friends who have liked a particular status message
      • Creating an event
      • Paging through a user's friends
      • Searching through a user's feed
      • Tagging users in a picture
      • Adding a subscription for real time updates related to a user object
      • Creating a callback for handling real time updates
      • Deleting subscriptions
      • Chapter 3: Querying Facebook
        • Introduction
        • Returning information about a user
        • Getting the status messages of a user
        • Retrieving profile pictures of a user's friends
        • Getting the links posted by a user
        • Getting the Facebook pages followed by a user
        • Determining if two users are friends
        • Retrieving information of a group
        • Retrieving members of a group
        • Retrieving friends from a specific friend list
        • Getting all the messages in a thread
        • Checking the status of permissions for an application
        • Getting notifications, and their senders, for the current user
        • Retrieving video details associated with a user
        • Getting the five latest photos in which a user has been tagged
        • Retrieving the latest photos published by a user
        • Retrieving details of an event
        • Retrieving details of a user's friends by using the multiquery method
        • Chapter 4: Using FB Script
          • Introduction
          • Getting the current user status and performing session validation
          • Setting up extended permissions during login
          • Logging out a user
          • Resetting the size of iframe
          • Making a Graph API call
          • Executing an FQL query
          • Subscribing to an event change
          • Unsubscribing to an event change
          • Retrieving a profile picture using XFBML
          • Adding bookmarks using XFBML
          • Authentication and setting up extended permissions using XFBML
          • Chapter 5: Expressing Yourself
            • Introduction
            • Prompting the user to publish a story
            • Using Dialog to add someone as a friend
            • Using the OAuth Dialog to request permissions for your application
            • Prompting the user to send a request to friends
            • Processing requests sent to the user by friends
            • Chapter 6: Bringing Facebook to your Website
              • Introduction
              • Setting up the Like button on your web page
              • Adding a Like box
              • Setting up the Activity Feed plugin
              • Setting up the Facepile plugin on your web page
              • Integrating the Live Stream plugin using XFBML
              • Integrating the Comment box using XFBML
              • Integrating the Send button using XFBML
              • Login with Faces
                • Chapter 8: Fiddling with Virtual Currency
                  • Introduction
                  • Setting up the application for Facebook Credits
                  • Setting up an application callback for Facebook Credits
                  • Creating Facebook Credits frontend using JavaScript SDK
                  • Getting the order details
                  • Implementing custom offers
                  • Refunding the order
                  • Developing a "Send a Gift" application and integrating with Facebook Credits
                  • Chapter 9: Creating Advertisements and Analyzing Metric Data
                    • Introduction
                    • Retrieving impressions of the Like Box plugin
                    • Retrieving a page's stream views and wall posts using batch request
                    • Getting the number of installations of an application using FQL
                    • Getting statistics about visitors using FQL multiquery
                    • Creating a new ad for your Facebook application
                    • Chapter 10: Creating Instant Applications
                      • Introduction
                      • Creating a "Your Good Luck Charm of the Day" Facebook application
                      • Designing a "My Fast Friends" Facebook application
                      • Setting up a photo collage
                      • Building a birthday calendar
                      • Developing an application to classify friends according to the cities they live in
                      • Chapter 11: Using Facebook Open Graph Beta
                        • Introduction
                        • Setting up your application for using Facebook Open Graph Beta
                        • Defining actions, objects, and aggregations for your application
                        • Customizing the Facebook Auth Dialog box
                        • Requesting permission for publishing to the user's timeline
                        • Defining your web page as a a Facebook graph object
                        • Publishing actions of a user to Facebook

                        Shashwat Srivastava

                        Shashwat Srivastava has been an avid coder since high school and has acquired technical proficiency in various programming languages with over 12 years experience. He is a strong advocate of open source tools and hosts his projects at SourceForge. He has successfully participated in Google Summer of Code Programs 2010 and 2011. He graduated as Bachelor in Electronics and Communication from Delhi College of Engineering in 2011. During his college days, Shashwat published websites for several clients including his college library and electronics department. Currently, he is working as an application developer at Oracle. He actively contributes to Drupal and has developed modules such as DrupalChat, DXMPP and Chatroom. His keen interest lies in web application development and as a result he has built several Facebook and Twitter applications. Passionate about programming he loves to blog about PHP, JavaScript, MySQL, Linux, Android and other insanities at http://www.botskool.com. When unplugged, he enjoys playing chess and computer games.

                        Apeksha Singh

                        Apeksha Singh is a software engineer and an open source hobbyist and enthusiast. She has recently graduated as a Computer Science Engineer from Jaypee Institute of Information Technology and has extensive experience in web development and search engine optimization. She has authored articles and research papers in these fields. She has programming experience of seven years and loves data structure. Obsessed with new technology, Apeksha keeps track of the latest developments in the tech world and likes to update others and share her views by blogging at http://www.botskool.com. She has also worked in the field of embedded systems and robotics. In her free time, she reads novels and plays sports such as badminton and tennis. She can be reached at her personal blog - http://apeksha0701.blogspot.com.

                        Code Downloads

                        Download the code and support files for this book.

                        Submit Errata

                        Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

                        Sample chapters

                        You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                        Frequently bought together

                        Facebook Application Development with Graph API Cookbook +    Developing Microsoft Dynamics GP Business Applications =
                        50% Off
                        the second eBook
                        Price for both: $44.10

                        Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                        What you will learn from this book

                        • Install Facebook PHP SDK and register your Facebook application
                        • Obtain access token and perform session validation for current Facebook user
                        • Work with the newly launched Facebook Graph API
                        • Get an insight into the core of Facebook application development such as creating a post on wall, publishing pictures, tagging users, etc
                        • Connect to Facebook Social Graph by using Facebook PHP and JavaScript SDKs
                        • Leverage Facebook Query Language in order to obtain complex Facebook user data
                        • Use Facebook Dialogs to enhance user experience
                        • Power your websites with Facebook Social Plugins
                        • Define your website content to Facebook Graph using Facebook Open Graph Protocol
                        • Handle transactions through Facebook Credits
                        • Use XFBML tags to enrich your application
                        • Extract Facebook application analytics data
                        • Create your own applications, from tip to toe, with ready to use code


                        In Detail

                        With a user base of nearly 800 million people, Facebook is the number one social networking platform. Applications can be created to interact with this huge user base in various ways both inside and outside Facebook. These applications, if developed effectively and efficiently, offer a free medium for promotion and publicity of a product or an organization.

                        Facebook Application Development with Graph API Cookbook covers both the concepts and implementations necessary to develop Facebook applications and provides ready to use code for common scenarios faced by a developer while creating these applications. It incorporates the newly launched Facebook Graph API and also presents the reader with some intuitive ready to use applications.

                        This book guides the reader step by step, from start to finish, through various stages of Facebook application development. It begins by exploring the Facebook application registration and discussing the verification and authentication technique. It then takes you through the various ways in which you can use Facebook Graph API for interacting with users such as posting on a user’s wall, tagging a user in a picture, etc. Accessing complex Facebook user data by formulating a series of queries, doing client side scripting and incorporating Facebook Dialog interface are some other features that have been incorporated in this book. Integration of various Facebook Social Plugins such as the like box in your web page has also been discussed. Further you will get to know the concept of virtual currency and how to programmatically derive Facebook analytics data. As the book progresses, you will learn to use and integrate many more advanced features in Facebook application development. The book contains ready to use code that can be deployed instantly. Towards the end, the book houses a variety of ready to use Facebook applications so as to help readers derive their own applications from them.


                        Written in a cookbook style, this book offers solutions using a recipe-based approach. Each recipe contains step-by-step instructions followed by an analysis of what was done in each task and other useful information. The cookbook approach means you can dive into whatever recipes you want in no particular order. The book provides tips and tricks to the most common problems and scenarios faced in Facebook Application Development.

                        Who this book is for

                        This book is written for Facebook developers ranging from novice to expert. It uses PHP, HTML and jQuery, the most commonly used platforms, to build applications in Facebook.

                        Code Download and Errata
                        Packt Anytime, Anywhere
                        Register Books
                        Print Upgrades
                        eBook Downloads
                        Video Support
                        Contact Us
                        Awards Voting Nominations Previous Winners
                        Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                        Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software