O'Reilly logo

Twitter® Application Development for Dummies® by Dusty Reagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Communication Through Tweets

In This Chapter

  • Working with" API communication methods

  • Update your Twitter status

  • Manage a user's timeline

  • More working examples of the API in PHP

This chapter covers API methods that allow users to communicate over Twitter. Communicating over Twitter involves consuming and creating tweets. Some ways you can work with tweets are by:

  • Updating your status

  • Sending a direct message

  • Favoriting a tweet

  • Searching for tweets

Status Methods

Status methods are methods that deal directly with tweets. They are used to create, delete, get details on, and retweet a tweet. There are six status methods, including:

  • statuses/show

  • statuses/update

  • statuses/destroy

  • statuses/retweet

  • statuses/retweets

Get the details of a specific tweet

You can get the complete details of a tweet and the user who wrote it with the statuses/show method.

This method doesn't require authentication, but to get the details of a protected Twitter account, you must

  • Authenticate your API call.

  • Have permission to view the protected account.

This method requires a GET request and is rate limited. Chapter 7 explains the concern with rate limits.

Output

This method has two output formats:

  • XML

  • JSON

On a successful method call, it returns the complete status object, which contains the complete user object of the author.

If the tweet doesn't exist you will receive an error message and a HTTP status code of 404.

Input

This method requires one parameter, the id of the tweet.

  • id: The numerical id of the status update.

    Example: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required