Posting a tweet

In this section, we will learn how to tweet about a product using the Twitter4J API. The approach to achieve this is as follows:

  • Create a Twitter button
  • Set up a new Twitter application
  • Develop a Twitter servlet
  • Develop a Twitter callback servlet

The following diagram shows the important entities involved in a Twitter-based client application. The arrow marks represent the communication between each component while posting a tweet to a user timeline:

Posting a tweet

Creating a Twitter button

In this section, we will create a Tweet button for each product. When this button is clicked, a message is posted to the user's timeline about the product. The following ...

Get Developing Responsive Web Applications with AJAX and jQuery now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.