twitter4j
Class Twitter

java.lang.Object
  extended by twitter4j.Twitter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AsyncTwitter

public class Twitter
extends java.lang.Object
implements java.io.Serializable

A java reporesentation of the Twitter API

See Also:
Serialized Form

Field Summary
static twitter4j.Twitter.Device IM
           
static twitter4j.Twitter.Device NONE
           
static twitter4j.Twitter.Device SMS
           
 
Constructor Summary
Twitter()
           
Twitter(java.lang.String baseURL)
           
Twitter(java.lang.String id, java.lang.String password)
           
Twitter(java.lang.String id, java.lang.String password, java.lang.String baseURL)
           
 
Method Summary
 java.util.List<Status> archive()
          Returns 80 statuses per page for the authenticating user, ordered by descending date of posting.
 java.util.List<Status> archive(int page)
          Returns 80 statuses per page for the authenticating user, ordered by descending date of posting.
 User block(java.lang.String id)
          Blocks the user specified in the ID parameter as the authenticating user.
 User create(java.lang.String id)
          Befriends the user specified in the ID parameter as the authenticating user.
 Status createFavorite(int id)
          Favorites the status specified in the ID parameter as the authenticating user.
 DirectMessage deleteDirectMessage(int id)
          Destroys the direct message specified in the required ID parameter.
 User destroy(java.lang.String id)
          Discontinues friendship with the user specified in the ID parameter as the authenticating user.
 Status destroyFavorite(int id)
          Un-favorites the status specified in the ID parameter as the authenticating user.
 boolean equals(java.lang.Object obj)
           
 java.util.List<Status> favorites()
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 java.util.List<Status> favorites(int page)
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 java.util.List<Status> favorites(java.lang.String id)
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 java.util.List<Status> favorites(java.lang.String id, int page)
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 User follow(java.lang.String id)
          Enables notifications for updates from the specified user to the authenticating user.
 void forceUsePost(boolean forceUsePost)
          set true to force using POST method communicating to the server
 java.lang.String getBaseURL()
          Returns the base URL
 java.util.List<DirectMessage> getDirectMessages()
          Returns a list of the direct messages sent to the authenticating user.
 java.util.List<DirectMessage> getDirectMessages(java.util.Date since)
          Returns a list of the direct messages sent to the authenticating user.
 java.util.List<DirectMessage> getDirectMessages(int sinceId)
          Returns a list of the direct messages sent to the authenticating user.
 java.util.List<DirectMessage> getDirectMessagesByPage(int page)
          Returns a list of the direct messages sent to the authenticating user.
 java.lang.String getDowntimeSchedule()
          Returns the same text displayed on http://twitter.com/home when a maintenance window is scheduled, in the requested format.
 java.util.List<User> getFeatured()
          Returns a list of the users currently featured on the site with their current statuses inline.
 java.util.List<User> getFollowers()
          Returns the authenticating user's followers, each with current status inline.
 java.util.List<User> getFriends()
          Returns the specified user's friends, each with current status inline.
 java.util.List<User> getFriends(int page)
          Returns the specified user's friends, each with current status inline.
 java.util.List<User> getFriends(java.lang.String id)
          Returns the user's friends, each with current status inline.
 java.util.List<User> getFriends(java.lang.String id, int page)
          Returns the user's friends, each with current status inline.
 java.util.List<Status> getFriendsTimeline()
          Returns the 20 most recent statuses posted in the last 24 hours from the authenticating1 user and that user's friends.
 java.util.List<Status> getFriendsTimeline(java.util.Date since)
          Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.
 java.util.List<Status> getFriendsTimeline(java.lang.String id)
          Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Status> getFriendsTimeline(java.lang.String id, java.util.Date since)
          Returns the most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Status> getFriendsTimelineByPage(int page)
          Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.
 java.util.List<Status> getFriendsTimelineByPage(java.lang.String id, int page)
          Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
 java.lang.String getPassword()
          Returns authenticating password
 java.util.List<Status> getPublicTimeline()
          Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
 java.util.List<Status> getPublicTimeline(int sinceID)
          Returns only public statuses with an ID greater than (that is, more recent than) the specified ID.
 java.util.List<Status> getPublicTimeline(java.lang.String sinceID)
          Deprecated. argument should be always numeric. Use getPublicTimeline(int sinceID) instead
 java.util.List<Status> getReplies()
          Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user.
 java.util.List<Status> getRepliesByPage(int page)
          Returns the most recent replies (status updates prefixed with @username) to the authenticating user.
 java.util.List<DirectMessage> getSentDirectMessages()
          Returns a list of the direct messages sent by the authenticating user.
 java.util.List<DirectMessage> getSentDirectMessages(java.util.Date since)
          Returns a list of the direct messages sent by the authenticating user.
 java.util.List<DirectMessage> getSentDirectMessages(int sinceId)
          Returns a list of the direct messages sent by the authenticating user.
 java.lang.String getSource()
          Returns the source
 UserWithStatus getUserDetail(java.lang.String id)
          Returns extended information of a given user, specified by ID or screen name as per the required id parameter below.
 java.lang.String getUserId()
          Returns authenticating userid
 java.util.List<Status> getUserTimeline()
          Returns the most recent statuses posted in the last 24 hours from the authenticating user.
 java.util.List<Status> getUserTimeline(int count, java.util.Date since)
          Returns the most recent statuses posted in the last 24 hours from the authenticating user.
 java.util.List<Status> getUserTimeline(java.lang.String id)
          Returns the most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Status> getUserTimeline(java.lang.String id, java.util.Date since)
          Returns the most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Status> getUserTimeline(java.lang.String id, int count)
          Returns the most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Status> getUserTimeline(java.lang.String id, int count, java.util.Date since)
          Returns the most recent statuses posted in the last 24 hours from the specified userid.
 int hashCode()
           
 boolean isUsePostForced()
           
 User leave(java.lang.String id)
          Disables notifications for updates from the specified user to the authenticating user.
 DirectMessage sendDirectMessage(java.lang.String id, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 void setBaseURL(java.lang.String baseURL)
          Sets the base URL
 void setPassword(java.lang.String password)
          Sets the password
 void setRequestHeader(java.lang.String name, java.lang.String value)
          sets the request header name/value combination see Twitter Fan Wiki for detail.
 void setRetryCount(int retryCount)
           
 void setRetryIntervalSecs(int retryIntervalSecs)
           
 void setSource(java.lang.String source)
          Sets the source parameter that will be passed by updating methods
 void setUserId(java.lang.String userId)
          Sets the userid
 Status show(int id)
          Returns a single status, specified by the id parameter.
 boolean test()
          Returns the string "ok" in the requested format with a 200 OK HTTP status code.
 User unblock(java.lang.String id)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 Status update(java.lang.String status)
          Updates the user's status.
 User updateDeliverlyDevice(twitter4j.Twitter.Device device)
          Sets which device Twitter delivers updates to for the authenticating user.
 User updateLocation(java.lang.String location)
          Update the location
 boolean verifyCredentials()
          Returns true if authentication was successful.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IM

public static final twitter4j.Twitter.Device IM

SMS

public static final twitter4j.Twitter.Device SMS

NONE

public static final twitter4j.Twitter.Device NONE
Constructor Detail

Twitter

public Twitter()

Twitter

public Twitter(java.lang.String baseURL)

Twitter

public Twitter(java.lang.String id,
               java.lang.String password)

Twitter

public Twitter(java.lang.String id,
               java.lang.String password,
               java.lang.String baseURL)
Method Detail

setBaseURL

public void setBaseURL(java.lang.String baseURL)
Sets the base URL

Parameters:
baseURL - String the base URL

getBaseURL

public java.lang.String getBaseURL()
Returns the base URL

Returns:
the base URL

setUserId

public void setUserId(java.lang.String userId)
Sets the userid

Parameters:
userId - new userid

getUserId

public java.lang.String getUserId()
Returns authenticating userid

Returns:
userid

setPassword

public void setPassword(java.lang.String password)
Sets the password

Parameters:
password - new password

getPassword

public java.lang.String getPassword()
Returns authenticating password

Returns:
password

setSource

public void setSource(java.lang.String source)
Sets the source parameter that will be passed by updating methods

Parameters:
source - the new source

getSource

public java.lang.String getSource()
Returns the source

Returns:
source

setRequestHeader

public void setRequestHeader(java.lang.String name,
                             java.lang.String value)
sets the request header name/value combination see Twitter Fan Wiki for detail. http://twitter.pbwiki.com/API-Docs#RequestHeaders

Parameters:
name - the name of the request header
value - the value of the request header

forceUsePost

public void forceUsePost(boolean forceUsePost)
set true to force using POST method communicating to the server

Parameters:
forceUsePost - if true POST method will be used forcibly

isUsePostForced

public boolean isUsePostForced()
Returns:
true if POST is used forcibly

getPublicTimeline

public final java.util.List<Status> getPublicTimeline()
                                               throws TwitterException
Returns the 20 most recent statuses from non-protected users who have set a custom user icon.

Returns:
list of statuses of the Public Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getPublicTimeline

public final java.util.List<Status> getPublicTimeline(java.lang.String sinceID)
                                               throws TwitterException
Deprecated. argument should be always numeric. Use getPublicTimeline(int sinceID) instead

Returns only public statuses with an ID greater than (that is, more recent than) the specified ID.

Parameters:
sinceID - returns only public statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
the 20 most recent statuses
Throws:
TwitterException - when Twitter service or network is unavailable

getPublicTimeline

public final java.util.List<Status> getPublicTimeline(int sinceID)
                                               throws TwitterException
Returns only public statuses with an ID greater than (that is, more recent than) the specified ID.

Parameters:
sinceID - returns only public statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
the 20 most recent statuses
Throws:
TwitterException - when Twitter service or network is unavailable

getFriendsTimeline

public final java.util.List<Status> getFriendsTimeline()
                                                throws TwitterException
Returns the 20 most recent statuses posted in the last 24 hours from the authenticating1 user and that user's friends. It's also possible to request another user's friends_timeline via the id parameter below.

Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getFriendsTimelineByPage

public final java.util.List<Status> getFriendsTimelineByPage(int page)
                                                      throws TwitterException
Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.

Parameters:
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getFriendsTimeline

public final java.util.List<Status> getFriendsTimeline(java.lang.String id)
                                                throws TwitterException
Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getFriendsTimelineByPage

public final java.util.List<Status> getFriendsTimelineByPage(java.lang.String id,
                                                             int page)
                                                      throws TwitterException
Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getFriendsTimeline

public final java.util.List<Status> getFriendsTimeline(java.util.Date since)
                                                throws TwitterException
Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.

Parameters:
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getFriendsTimeline

public final java.util.List<Status> getFriendsTimeline(java.lang.String id,
                                                       java.util.Date since)
                                                throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the specified userid.

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getUserTimeline

public final java.util.List<Status> getUserTimeline(java.lang.String id,
                                                    int count,
                                                    java.util.Date since)
                                             throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the specified userid.

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
count - specifies the number of statuses to retrieve. May not be greater than 20 for performance purposes
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
list of the user Timeline
Throws:
TwitterException - when Twitter service or network is unavailable

getUserTimeline

public final java.util.List<Status> getUserTimeline(java.lang.String id,
                                                    java.util.Date since)
                                             throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the specified userid.

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable

getUserTimeline

public final java.util.List<Status> getUserTimeline(java.lang.String id,
                                                    int count)
                                             throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the specified userid.

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
count - specifies the number of statuses to retrieve. May not be greater than 20 for performance purposes
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable

getUserTimeline

public final java.util.List<Status> getUserTimeline(int count,
                                                    java.util.Date since)
                                             throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the authenticating user.

Parameters:
count - specifies the number of statuses to retrieve. May not be greater than 20 for performance purposes
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable

getUserTimeline

public final java.util.List<Status> getUserTimeline(java.lang.String id)
                                             throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the specified userid.

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable

getUserTimeline

public final java.util.List<Status> getUserTimeline()
                                             throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the authenticating user.

Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable

show

public final Status show(int id)
                  throws TwitterException
Returns a single status, specified by the id parameter. The status's author will be returned inline.

Parameters:
id - the numerical ID of the status you're trying to retrieve
Returns:
a single status
Throws:
TwitterException - when Twitter service or network is unavailable

update

public Status update(java.lang.String status)
              throws TwitterException
Updates the user's status. The text will be trimed if the length of the text is exceeding 160 characters.

Parameters:
status - the text of your status update
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable

getReplies

public final java.util.List<Status> getReplies()
                                        throws TwitterException
Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected.

Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable

getRepliesByPage

public final java.util.List<Status> getRepliesByPage(int page)
                                              throws TwitterException
Returns the most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected.

Parameters:
page - the number of page
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable

getFriends

public final java.util.List<User> getFriends()
                                      throws TwitterException
Returns the specified user's friends, each with current status inline.

Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable

getFriends

public final java.util.List<User> getFriends(int page)
                                      throws TwitterException
Returns the specified user's friends, each with current status inline.

Parameters:
page - number of page
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable

getFriends

public final java.util.List<User> getFriends(java.lang.String id)
                                      throws TwitterException
Returns the user's friends, each with current status inline.

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable

getFriends

public final java.util.List<User> getFriends(java.lang.String id,
                                             int page)
                                      throws TwitterException
Returns the user's friends, each with current status inline.

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

getFollowers

public final java.util.List<User> getFollowers()
                                        throws TwitterException
Returns the authenticating user's followers, each with current status inline.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

getFeatured

public final java.util.List<User> getFeatured()
                                       throws TwitterException
Returns a list of the users currently featured on the site with their current statuses inline.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

getUserDetail

public final UserWithStatus getUserDetail(java.lang.String id)
                                   throws TwitterException
Returns extended information of a given user, specified by ID or screen name as per the required id parameter below. This information includes design settings, so third party developers can theme their widgets according to a given user's preferences.

Parameters:
id - the ID or screen name of the user for whom to request the detail
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable

getDirectMessages

public final java.util.List<DirectMessage> getDirectMessages()
                                                      throws TwitterException
Returns a list of the direct messages sent to the authenticating user.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

getDirectMessagesByPage

public final java.util.List<DirectMessage> getDirectMessagesByPage(int page)
                                                            throws TwitterException
Returns a list of the direct messages sent to the authenticating user.

Parameters:
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

getDirectMessages

public final java.util.List<DirectMessage> getDirectMessages(int sinceId)
                                                      throws TwitterException
Returns a list of the direct messages sent to the authenticating user.

Parameters:
sinceId - int
Returns:
list of direct messages
Throws:
TwitterException - when Twitter service or network is unavailable

getDirectMessages

public final java.util.List<DirectMessage> getDirectMessages(java.util.Date since)
                                                      throws TwitterException
Returns a list of the direct messages sent to the authenticating user.

Parameters:
since - narrows the resulting list of direct messages to just those sent after the specified HTTP-formatted date
Returns:
list of direct messages
Throws:
TwitterException - when Twitter service or network is unavailable

getSentDirectMessages

public final java.util.List<DirectMessage> getSentDirectMessages()
                                                          throws TwitterException
Returns a list of the direct messages sent by the authenticating user.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

getSentDirectMessages

public final java.util.List<DirectMessage> getSentDirectMessages(java.util.Date since)
                                                          throws TwitterException
Returns a list of the direct messages sent by the authenticating user.

Parameters:
since - narrows the resulting list of direct messages to just those sent after the specified HTTP-formatted date
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

getSentDirectMessages

public final java.util.List<DirectMessage> getSentDirectMessages(int sinceId)
                                                          throws TwitterException
Returns a list of the direct messages sent by the authenticating user.

Parameters:
sinceId - returns only sent direct messages with an ID greater than (that is, more recent than) the specified ID
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

sendDirectMessage

public final DirectMessage sendDirectMessage(java.lang.String id,
                                             java.lang.String text)
                                      throws TwitterException
Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. The text will be trimed if the length of the text is exceeding 140 characters.

Parameters:
id - the ID or screen name of the user to whom send the direct message
text - String
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable

deleteDirectMessage

public final DirectMessage deleteDirectMessage(int id)
                                        throws TwitterException
Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message.

Parameters:
id - the ID of the direct message to destroy
Returns:
the deleted direct message
Throws:
TwitterException - when Twitter service or network is unavailable

create

public final User create(java.lang.String id)
                  throws TwitterException
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

Parameters:
id - the ID or screen name of the user to be befriended
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable

destroy

public final User destroy(java.lang.String id)
                   throws TwitterException
Discontinues friendship with the user specified in the ID parameter as the authenticating user. Returns the un-friended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable

verifyCredentials

public final boolean verifyCredentials()
Returns true if authentication was successful. Use this method to test if supplied user credentials are valid with minimal overhead.

Returns:
success

archive

public final java.util.List<Status> archive()
                                     throws TwitterException
Returns 80 statuses per page for the authenticating user, ordered by descending date of posting. Use this method to rapidly export your archive of statuses.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

archive

public final java.util.List<Status> archive(int page)
                                     throws TwitterException
Returns 80 statuses per page for the authenticating user, ordered by descending date of posting. Use this method to rapidly export your archive of statuses.

Parameters:
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

updateLocation

public final User updateLocation(java.lang.String location)
                          throws TwitterException
Update the location

Parameters:
location - the current location of the user
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
twitter4j 1.0.4

updateDeliverlyDevice

public final User updateDeliverlyDevice(twitter4j.Twitter.Device device)
                                 throws TwitterException
Sets which device Twitter delivers updates to for the authenticating user. Sending none as the device parameter will disable IM or SMS updates.

Parameters:
device - new Delivery device. Must be one of: IM, SMS, NONE.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
twitter4j 1.0.4

favorites

public final java.util.List<Status> favorites()
                                       throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

favorites

public final java.util.List<Status> favorites(int page)
                                       throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

favorites

public final java.util.List<Status> favorites(java.lang.String id)
                                       throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

favorites

public final java.util.List<Status> favorites(java.lang.String id,
                                              int page)
                                       throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable

createFavorite

public final Status createFavorite(int id)
                            throws TwitterException
Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.

Parameters:
id - the ID of the status to favorite
Returns:
Status
Throws:
TwitterException - when Twitter service or network is unavailable

destroyFavorite

public final Status destroyFavorite(int id)
                             throws TwitterException
Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.

Parameters:
id - the ID of the status to un-favorite
Returns:
Status
Throws:
TwitterException - when Twitter service or network is unavailable

follow

public final User follow(java.lang.String id)
                  throws TwitterException
Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

Parameters:
id - String
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable

leave

public final User leave(java.lang.String id)
                 throws TwitterException
Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

Parameters:
id - String
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable

block

public final User block(java.lang.String id)
                 throws TwitterException
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.

Parameters:
id - the ID or screen_name of the user to block
Returns:
the blocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
twitter4j 1.0.4

unblock

public final User unblock(java.lang.String id)
                   throws TwitterException
Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.

Parameters:
id - the ID or screen_name of the user to block
Returns:
the unblocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
twitter4j 1.0.4

test

public final boolean test()
                   throws TwitterException
Returns the string "ok" in the requested format with a 200 OK HTTP status code.

Returns:
true if the API is working
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
twitter4j 1.0.4

getDowntimeSchedule

public final java.lang.String getDowntimeSchedule()
                                           throws TwitterException
Returns the same text displayed on http://twitter.com/home when a maintenance window is scheduled, in the requested format.

Returns:
the schedule
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
twitter4j 1.0.4

setRetryCount

public void setRetryCount(int retryCount)

setRetryIntervalSecs

public void setRetryIntervalSecs(int retryIntervalSecs)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object