Thursday, September 29, 2011

Twitter API Up and Running






Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
1. Hello Twitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What Are You Doing? 2
Rules of Engagement 4
Opportunistic Interruptions 6
Twitter Is Like a Side-by-Side Conversation 8
History of Twitter 9
A Brief History of Microblogging 10
Believe It or Not: Twitter Was Inspired by Bike Couriers 12
Millions and Millions Served 14
The Rise of the Fail Whale 16
Who Wants to Be a Millionaire? Gauging Twitter’s Profitability 20
Developers Are Users, Too 23
Creative Uses of Twitter 25
Twitter Utilitarianism 26
Twitter for News 27
Twitter for Science 28
Twitter for God 29
Twitter for Emergencies 30
Twitter for Marketing 31
Twitter for Social Change 32
Twitter for Money 34
Twitter for Games 34
Twitter for Anthropomorphism 35
Twitter for Help 36
Twitter for Creativity 37
Twitter for Education 38
Twitter for Entertainment 38
Twitter for Sports 39
Twitter for Evil 40
Twitter As a Shared Event 41Twitter for Everyone 42
A Changing Culture 43
2. Twitter Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Twitter’s Open API 46
Finding Inspiration 47
Tools for Publishing 48
Twitterfeed 48
SnapTweet 49
SecretTweet 50
Tools for the Information Stream 51
Twittervision 52
Twitter Matrix 53
Twalala 54
Tools of Appropriation 55
Track This 55
LiveTwitting 56
FoodFeed 57
Tools for Search 58
TwitDir 59
Green Tweets 60
TweetBeep 61
Tweet Scan 62
Favrd 63
Tools of Aggregation 64
Twappi 64
Twitscoop 65
Twist 66
Tools for Statistics 67
What’s Your Tweet Worth? 67
TweetStats 68
Follow Cost 70
Twitter Grader 71
Twitterank 72
Tools for the Follow Network 74
Does Follow 74
Qwitter 75
Friend or Follow 76
Mr. Tweet 77
Omnee 78
Twitree 79
And Many More 80
3. Web Programming Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
XHTML 83
Web Pages 84
A Nod to Some Other XML Structures 89
CSS 90
Assigning Styles to Structure 92
Laying Out Your Web Page Content 93
Decorating the Web Page Content 94
Getting the Browser to Recognize Styles 95
PHP 96
How to Accept Candy from Strangers 97
Strings, Arrays, and Objects 98
Manipulating the Data You Collect 100
Knowing Your Environment 104
Controlling the Flow of Logic 106
File Management 109
Connecting to the Database 111
Building a Custom Function 113
SimpleXML 116
DOM 117
cURL 118
Debugging 120
MySQL 122
Creating a New Table 123
Retrieving Information from the Database 124
Changing Information in the Database 125
A Place to Call /home 126
Selecting a Host Server 126
Automation 128
Further Reading 130
4. Meet the Twitter API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Accessing the API 134
HTTP Requests 134
HTTP Status Codes 137
Format 139
Authentication 140
A Peak at OAuth 141
Parameters 143
Rate Limiting 147
Keeping Development Light 148
Play Along at Home 149
The API Methods 150
Publishing 151
The Information Stream 152
The Follow Network 157
Communication 165
Member Account 168
API Administration 174
Search 176
Other Data Options 181
Gone Phishing: A Word About Passwords 182
Is Twishing Worth the Effort? 184
OAuth Can Help 187
5. Meet the Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
User Objects 192
User Elements 195
Status Objects 198
Status Elements 200
Message Objects 202
Direct Message Elements 204
Search Objects 205
Feed Elements 206
Entry Elements 207
ID Objects 208
ID Elements 208
Response Objects 209
Response Elements 209
Hash Objects 209
Hash Elements 210
Errors 211
6. Application Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Establishing Your Twitter Account 214
Registering a New Twitter Member Account 215
Configuring Your New Account 217
Creating Your Database 222
Making Sure There Is a There There 223
Giving the Database Some Structure 223
Included Functions 227
Creating Your Includes Directory 227
Environment Functions 229
API Configuration Functions 230
Database Functions 234
SQL Queries 235
Data Parsing Functions 240
Password Management Functions 246
Data Validation Functions 249
Data Sorting Functions 252
Statistics Functions 253
Log Management Functions 254
Status Messages 255
HTML Template Functions 257
CSS 260
7. Sample Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Meet the Sample Apps 263
Why Are You Asking for My Password? 265
Administration Tool 267
Take the App for a Spin 267
Check Under the Hood 268
Shifting Gears 275
Tweet Publisher 277
Take the App for a Spin 277
Check Under the Hood 278
Shifting Gears 282
Auto Tweet 282
Take the App for a Spin 283
Check Under the Hood 284
Shifting Gears 290
Tweet Broadcast 291
Take the App for a Spin 291
Check Under the Hood 293
Shifting Gears 299
Broadcast Feed 300
Take the App for a Spin 300
Check Under the Hood 300
Shifting Gears 304
Tweet Alert 305
Take the App for a Spin 305
Check Under the Hood 307
Shifting Gears 312
Network Viewer 313
Take the App for a Spin 313
Check Under the Hood 315
Shifting Gears 323
Best of Twitter API 324
Take the App for a Spin 325
Check Under the Hood 326
Shifting Gears 329
8. Automated Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
RSS to Tweet 332
Check Under the Hood 333
Aggregate Broadcast 338
Check Under the Hood 339
Scan Tweets 342
Check Under the Hood 343
Queue Users 349
Check Under the Hood 350
Collect Favorites 352
Check Under the Hood 353
Appendix: Twitter API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377

Another Social Network Books
Download

No comments:

Post a Comment

Related Posts with Thumbnails

Put Your Ads Here!