Book Image

SPRING COOKBOOK

By : Jerome Jaglale, Yilmaz
Book Image

SPRING COOKBOOK

By: Jerome Jaglale, Yilmaz

Overview of this book

This book is for you if you have some experience with Java and web development (not necessarily in Java) and want to become proficient quickly with Spring.
Table of Contents (14 chapters)
13
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");