SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is the Rough Cut version of the printed book.
In The Developer’s Guide to Social Programming, Mark Hawker shows developers how to build applications that integrate with the major social networking sites. Unlike competitive books that focus on a single social media platform, this book covers all three leading platforms: Facebook, OpenSocial, and Twitter. Hawker identifies the characteristics of superior, highly engaging social media applications, and shows how to use the Facebook platform, Google Friend Connect, and the Twitter API to create them.
You’ll find practical solutions and code for addressing many common social programming challenges, from site registration to search, blog commenting to creating location-based applications. Hawker concludes by walking you through building a complete, integrated social application: one that works seamlessly across all leading platforms, and draws on powerful features from each. Coverage includes
I: Twitter
1 Working with the Twitter API 1
Twitter API Essentials 1
Twitter API Methods 3
Twitter API Parameters 6
Twitter API Return Formats 10
Accessing the Twitter API 11
cURL 12
Twitter-async 14
Twitter API Rate Limiting 17
Twitter API Error Handling 18
Summary 19
2 Diving Into the Twitter API Methods 21
Twitter API Methods 21
User Objects 23
Status Objects 26
Direct Message Objects 28
Saved Search Objects 29
ID Objects 30
Relationship Objects 31
Response Objects 32
Hash Objects 33
Twitter Search API 34
Introducing the Atom Syndication Format 34
Twitter Search API Methods 38
Summary 43
3 Authentication with Twitter OAuth 45
Introducing Twitter OAuth 45
OAuth Benefits 46
OAuth Definitions 46
Implementing Twitter OAuth 48
Twitter OAuth Workflow 48
Test Tube: A Sample Twitter Application 50
Summary 59
4 Extending the Twitter API: Retweets, Lists,
and Location 61
Extending Twitter’s Core Functionality 61
Retweet API 62
Lists API 64
Geolocation API 68
Twitter Community Evolution 71
Platform Translations 71
Spam Reporting 72
Future Directions 74
Summary 76
II: Facebook Platform
5 An Overview of Facebook Platform Website
Integration 77
Facebook Platform for Developers 77
Facebook Platform 78
Registering a Facebook Application 79
Referencing a Facebook Platform Application 81
Facebook API, FQL, and XFBML 84
Facebook API and FQL 84
XFBML 97
Summary 98
6 Registration, Authentication, and Translations with Facebook 99
User Authorization and Authentication 99
Logging In and Detecting Facebook Status 101
Logging Out, Disconnecting, and Reclaiming
Accounts 107
Connecting and Inviting Friends 109
Translations for Facebook 111
Preparing Your Application and Registering Text 111
Administering and Accessing Translations 113
Summary 114
7 Using Facebook for Sharing, Commenting, and Stream Publishing 115
Content-Sharing and Live Conversation 115
Facebook Share 116
Facebook Widgets 118
Social Commenting and Stream Publishing 120