org.springframework.social.twitter.api
Interface TimelineOperations


public interface TimelineOperations

Interface defining the operations for sending and retrieving tweets.


Method Summary
 void addToFavorites(long id)
          Adds a tweet to the user's collection of favorite tweets.
 void deleteStatus(long tweetId)
          Removes a status entry.
 java.util.List<Tweet> getFavorites()
          Retrieves the 20 most recent tweets favorited by the given user.
 java.util.List<Tweet> getFriendsTimeline()
           Retrieves the 20 most recently posted tweets, excluding retweets, from the authenticating user's home timeline.
 java.util.List<Tweet> getHomeTimeline()
          Retrieves the 20 most recently posted tweets, including retweets, from the authenticating user's home timeline.
 java.util.List<Tweet> getMentions()
          Retrieve the 20 most recent tweets that mention the authenticated user.
 java.util.List<Tweet> getPublicTimeline()
          Retrieves the 20 most recently posted tweets from the public timeline.
 java.util.List<TwitterProfile> getRetweetedBy(long id)
          Retrieves the profiles of up to 100 users how have retweeted a specific tweet.
 java.util.List<java.lang.Long> getRetweetedByIds(long id)
          Retrieves the IDs of up to 100 users who have retweeted a specific tweet.
 java.util.List<Tweet> getRetweetedByMe()
          Retrieve the 20 most recent retweets posted by the authenticated user.
 java.util.List<Tweet> getRetweetedToMe()
          Retrieve the 20 most recent retweets posted by users the authenticating user follow.
 java.util.List<Tweet> getRetweets(long tweetId)
          Retrieves up to 100 retweets of a specific tweet.
 java.util.List<Tweet> getRetweetsOfMe()
          Retrieve the 20 most recent tweets of the authenticated user that have been retweeted by others.
 Tweet getStatus(long tweetId)
          Returns a single tweet.
 java.util.List<Tweet> getUserTimeline()
          Retrieves the 20 most recent tweets posted by the authenticating user.
 java.util.List<Tweet> getUserTimeline(long userId)
          Retrieves the 20 most recent tweets posted by the given user.
 java.util.List<Tweet> getUserTimeline(java.lang.String screenName)
          Retrieves the 20 most recent tweets posted by the given user.
 void removeFromFavorites(long id)
          Removes a tweet from the user's collection of favorite tweets.
 void retweet(long tweetId)
          Posts a retweet of an existing tweet.
 void updateStatus(java.lang.String status)
          Updates the user's status.
 void updateStatus(java.lang.String status, StatusDetails details)
          Updates the user's status, including additional metadata concerning the status.
 

Method Detail

getPublicTimeline

java.util.List<Tweet> getPublicTimeline()
Retrieves the 20 most recently posted tweets from the public timeline. The public timeline is the timeline containing tweets from all Twitter users. As this is the public timeline, authentication is not required to use this method.

Note that Twitter caches public timeline results for 60 seconds. Calling this method more frequently than that will count against rate limits and will not return any new results.

Returns:
a collection of Tweets in the public timeline.

getHomeTimeline

java.util.List<Tweet> getHomeTimeline()
Retrieves the 20 most recently posted tweets, including retweets, from the authenticating user's home timeline. The home timeline includes tweets from the user's timeline and the timeline of anyone that they follow.

Returns:
a collection of Tweets in the authenticating user's home timeline.

getFriendsTimeline

java.util.List<Tweet> getFriendsTimeline()

Retrieves the 20 most recently posted tweets, excluding retweets, from the authenticating user's home timeline. The friends timeline includes tweets from the user's timeline and the timeline of anyone that they follow, with the exception of any retweets.

Returns:
a collection of Tweets in the authenticating user's friends timeline.

getUserTimeline

java.util.List<Tweet> getUserTimeline()
Retrieves the 20 most recent tweets posted by the authenticating user.

Returns:
a collection of Tweets that have been posted by the authenticating user.

getUserTimeline

java.util.List<Tweet> getUserTimeline(java.lang.String screenName)
Retrieves the 20 most recent tweets posted by the given user.

Parameters:
screenName - The screen name of the user whose timeline is being requested.
Returns:
a collection of Tweets from the specified user's timeline.

getUserTimeline

java.util.List<Tweet> getUserTimeline(long userId)
Retrieves the 20 most recent tweets posted by the given user.

Parameters:
userId - The user ID of the user whose timeline is being requested.
Returns:
a collection of Tweets from the specified user's timeline.

getMentions

java.util.List<Tweet> getMentions()
Retrieve the 20 most recent tweets that mention the authenticated user.

Returns:
a collection of Tweet objects that mention the authenticated user.

getRetweetedByMe

java.util.List<Tweet> getRetweetedByMe()
Retrieve the 20 most recent retweets posted by the authenticated user.


getRetweetedToMe

java.util.List<Tweet> getRetweetedToMe()
Retrieve the 20 most recent retweets posted by users the authenticating user follow.


getRetweetsOfMe

java.util.List<Tweet> getRetweetsOfMe()
Retrieve the 20 most recent tweets of the authenticated user that have been retweeted by others.


getStatus

Tweet getStatus(long tweetId)
Returns a single tweet.

Parameters:
tweetId - the tweet's ID

updateStatus

void updateStatus(java.lang.String status)
Updates the user's status.

Parameters:
status - The status message

updateStatus

void updateStatus(java.lang.String status,
                  StatusDetails details)
Updates the user's status, including additional metadata concerning the status.

Parameters:
status - The status message
details - Metadata pertaining to the status

deleteStatus

void deleteStatus(long tweetId)
Removes a status entry.

Parameters:
tweetId - the tweet's ID

retweet

void retweet(long tweetId)
Posts a retweet of an existing tweet.

Parameters:
tweetId - The ID of the tweet to be retweeted

getRetweets

java.util.List<Tweet> getRetweets(long tweetId)
Retrieves up to 100 retweets of a specific tweet.

Parameters:
tweetId - the tweet's ID

getRetweetedBy

java.util.List<TwitterProfile> getRetweetedBy(long id)
Retrieves the profiles of up to 100 users how have retweeted a specific tweet.

Parameters:
id - the tweet's ID

getRetweetedByIds

java.util.List<java.lang.Long> getRetweetedByIds(long id)
Retrieves the IDs of up to 100 users who have retweeted a specific tweet.

Parameters:
id - the tweet's ID.

getFavorites

java.util.List<Tweet> getFavorites()
Retrieves the 20 most recent tweets favorited by the given user.

Returns:
a collection of Tweets from the specified user's favorite timeline.

addToFavorites

void addToFavorites(long id)
Adds a tweet to the user's collection of favorite tweets.

Parameters:
id - the tweet's ID

removeFromFavorites

void removeFromFavorites(long id)
Removes a tweet from the user's collection of favorite tweets.

Parameters:
id - the tweet's ID