Book Image

SPRING COOKBOOK

Book Image

SPRING COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Spring Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Posting a tweet to Twitter


In this recipe, you'll learn how to post a tweet on behalf of a user from a Spring web application.

Getting ready

This recipe uses the code from the Connecting to Twitter recipe.

How to do it…

In the TwitterController class, in the tw() method, use the Twitter object to post a tweet.

twitter.timelineOperations().updateStatus("Just a test");