Facebook Application Development with Graph API Cookbook PDF

ebook img

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Facebook Application Development with Graph API Cookbook

Facebook Application Development with Graph API Cookbook Over 90 recipes to create your own exciting Facebook applications at an incredibly fast pace with Facebook Graph API Shashwat Srivastava Apeksha Singh [PACK ] PUBLISHING BIRMINGKAM - MUMBAI This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 Facebook Application Development with Graph API Cookbook Copyright © 2011 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: November 2011 Production Reference: 1091111 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84969-092-8 www.packtpub.com Cover Image by Siddharth Ravishankar ([email protected]) This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 Credits Authors Project Coordinator Shashwat Srivastava Shubhanjan Chatterjee Apeksha Singh Proofreader Reviewer Linda Morris Deepak Vohra Indexer Acquisition Editor Rekha Nair Wilson D'Souza Production Coordinator Development Editor Alwin Roy Swapna Verlekar Cover Work Technical Editors Alwin Roy Kedar Bhat Vanjeet D'souza Merwine Machado This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 About the Authors Shashwat Srivastava has been an avid coder since high school and has acquired technical proficiency in various programming languages with an experience of over twelve years. 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. Shashwat has graduated as a Bachelor of Electronics and Communication from Delhi College of Engineering in 2011. During his college days, he has 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. First of all, I need to thank my mother and father for being a constant source of inspiration and their endless support during the book writing process. Also, I would like to thank my dear brother Anmol for all the love and care. A huge thanks to all my friends who have given their valuable inputs on this book. Also, I would like to thank the team at Packt Publishing, along with David, Wilson, Swapna, Shubhanjan, and other editors and reviewers. Without them you wouldn't be reading this book. Finally, I want to thank most my friend and co-author, Apeksha, who has been with me since the beginning. She has put in a lot of efforts and worked diligently to make sure this book is complete. Thank you for reading this book. I hope you find it interesting and useful. This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 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 seven years of experience in the field of programming and loves data structures. Obsessed with new technology, Apeksha keeps track of the latest developments in the world of technology 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). I would like to thank the three most important people in my life, my dad for being my role model, my mom for all the love and support and my brother Abhinav for making me believe in myself. Also, I would like to thank my dear friends for coping with my occasional absence during the book writing stage and helping me whenever required. Most important, I would like to thank, my co-author Shashwat Srivastava for making this dream come true. A special thanks to the team at Packt Publishing without whom this book wouldn't have been possible. This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 About the Reviewer Deepak Vohra is a consultant and a principal member of the NuBean.com software company. Deepak is a Sun Certified Java Programmer and Web Component Developer, and has worked in the fields of XML and Java programming and J2EE for over five years. Deepak is the co-author of Pro XML Development with Java Technology, Apress and was the technical reviewer for WebLogic: The Definitive Guide, O'Reilly Media, and also the technical reviewer for Ruby Programming for the Absolute Beginner, Course Technology PTR, and the technical editor for Prototype and Scriptaculous in Action, Manning Publications. Deepak is also the author of JDBC 4.0 and Oracle JDeveloper for J2EE Development, Processing XML documents with Oracle JDeveloper 11gh, and EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g, all books published by Packt Publishing. This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@ packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? f Fully searchable across every book published by Packt f Copy and paste, print and bookmark content f On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014 Table of Contents Preface 1 Chapter 1: Creating a New Facebook Application 5 Introduction 5 Downloading PHP-SDK and setting up your environment 8 Registering a new Facebook application 10 Configuring a Facebook application 13 Getting authorization and a valid session for the user 15 Requesting specific permissions from the user 17 Logging out a user 20 Handling navigation in an iFrame Facebook application 21 Handling form submission in an iFrame Facebook application 23 Dynamically resizing an iFrame Facebook application 24 Determining whether a Facebook page has been liked by a user 27 Chapter 2: Be a part of Social Graph 31 Introduction 32 Retrieving a user's information 34 Liking a post 36 Commenting on a given post 38 Setting status message 41 Deleting a picture, post, or comment of a user 43 Retrieving the current user's friendlist 44 Creating a post on the wall of a user's friend 46 Posting a picture to a specific album of the user 49 Retrieving the names of the user's friends who have liked a particular status message 53 Creating an event 55 Paging through a user's friends 57 Searching through a user's feed 59 This material is copyright and is licensed for the sole use by REKHA NADENDLA on 2nd December 2011 375 N STEPHANIE ST SUITE 1411, HENDERSON, 89014

Description:

Over 100 recipes to create your own exciting Facebook applications at an incredibly fast pace with Facebook Graph API. 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 example