Sams Teach Yourself the Twitter API in 24 Hours

Sams Teach Yourself the Twitter API in 24 Hours

Language: English

Pages: 351

ISBN: B0058NWFK2

Format: PDF / Kindle (mobi) / ePub


In just 24 sessions of one hour or less, you’ll learn how to build great new social applications with the latest versions of the Twitter API. Using this book’s straightforward, step-by-step approach, you’ll discover all you can do with the Twitter API, and master everything from the absolute basics to the newest innovations. One step at a time, you’ll learn how to build Twitter clients and extend them with more power… use advanced features like streaming and geotagging… even build mobile Twitter apps for iPhone and Android! Each lesson builds on what you’ve already learned resulting in a fully functional Twitter application, giving you a strong real-world foundation for success, even if you’re completely new to Twitter development!

 

Step-by-step instructions carefully walk you through the most common Twitter API programming tasks.

 

Quizzes and Exercises at the end of each chapter help you test your knowledge.

 

By the Way notes present interesting information related to the discussion.

 

Did You Know? tips offer advice or show you easier ways to perform tasks.

 

Watch Out! cautions alert you to possible problems and give you advice on how to avoid them.

 

Learn how to…

  • Make the right upfront decisions in planning your application
  • Integrate Twitter support into existing sites, services, and applications
  • Set up your Twitter development environment
  • Make Twitter API calls, handle responses, and develop readers
  • Construct dynamic frameworks to efficiently generate and manage multiple API calls
  • Build basic clients and extend them to handle more powerful tasks
  • Securely access server resources with OAuth
  • Use Direct Messages, Lists, Search, and other Twitter API features
  • Enable users to control their accounts, establish favorites and friendships, send notifications, and block individuals
  • Build location-based, geotagged applications with Twitter’s GEO API
  • Give users up-to-the-minute information about the hottest Twitter topics
  • Get started with Twitter development for iPhone and Android
  • Understand the future of Twitter API development

 

Starting Out with Java: From Control Structures through Objects (5th Edition)

HTML5 Canvas for Dummies

Web Application Development with Yii and PHP (2nd Edition)

Start Here! Learn Microsoft Visual Basic 2012

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7.2 Example of three latest tweets from BREAKINGNEWS. This is the actual request we are sending Twitter. Using ‘echo’ to see what commands are being sent to Twitter is a great debugging tool. We will leave this in for now, but do remember to remove it once you feel comfortable with what these calls look like. Let’s add one more API function. Creating getPublicTime API Function First, let’s see what parameters Twitter supports for this API call. In this case, there is just one: ‘since_id.’ This

callback does not always work. If that happens, try using the following workaround: http://127.0.0.1:8000/twitter_callback. If this does not work, try this. You can use bit.ly, a URL-shortening service. Just shorten the url “http://localhost:3000/twitter_callback” and register the shortened URL as the callback in your Twitter app. For this method, you have to create another Twitter OAuth app for development so that the callback URLs can differ. (Thanks to Toni for this workaround:

are from anyone—a slight but important difference. Now let’s add a few new API calls. Edit parseTwitter.php We have added new tabs to our UI. Now we need to account for the new tabs in our parsing statement. Open parseTwitter.php, and after the following lines: case ‘direct’: { $messages=$twitter->getMessages(‘xml’); return ➥call_direct($messages); } break; Add these lines: case ‘rt_by_me’: { $messages=$twitter->getRTByMe(‘xml’); return ➥call_timeline($messages); } break; case ‘rt_to_me’: {

the destroy method in the beginning of this hour, we could use either POST or DELETE for this method call. We are going to use DELETE because it’s more informative when we read the code. Either way will work; however, using DELETE could prove to be more future proofed as Twitter continues to evolve the API set. Save and close the file. Now let’s give it a shot. Open index.php and click Favorites. Now click ‘Del’ on one of the messages. You should get an XML return similar to Figure 14.3 that

wisdom you’re willing to pass our way. You can email or write me directly to let me know what you did or didn’t like about this book—as well as what we can do to make our books stronger. Please note that I cannot help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message. When you write, please be sure to include this book’s title and author as well as your name and phone or email address. I

Download sample

Download