|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttwitter4j.Twitter
public class Twitter
A java reporesentation of the Twitter API
| 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 |
|---|
public static final twitter4j.Twitter.Device IM
public static final twitter4j.Twitter.Device SMS
public static final twitter4j.Twitter.Device NONE
| Constructor Detail |
|---|
public Twitter()
public Twitter(java.lang.String baseURL)
public Twitter(java.lang.String id,
java.lang.String password)
public Twitter(java.lang.String id,
java.lang.String password,
java.lang.String baseURL)
| Method Detail |
|---|
public void setBaseURL(java.lang.String baseURL)
baseURL - String the base URLpublic java.lang.String getBaseURL()
public void setUserId(java.lang.String userId)
userId - new useridpublic java.lang.String getUserId()
public void setPassword(java.lang.String password)
password - new passwordpublic java.lang.String getPassword()
public void setSource(java.lang.String source)
source - the new sourcepublic java.lang.String getSource()
public void setRequestHeader(java.lang.String name,
java.lang.String value)
name - the name of the request headervalue - the value of the request headerpublic void forceUsePost(boolean forceUsePost)
forceUsePost - if true POST method will be used forciblypublic boolean isUsePostForced()
public final java.util.List<Status> getPublicTimeline()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getPublicTimeline(java.lang.String sinceID)
throws TwitterException
sinceID - returns only public statuses with an ID greater than (that is, more recent than) the specified ID
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getPublicTimeline(int sinceID)
throws TwitterException
sinceID - returns only public statuses with an ID greater than (that is, more recent than) the specified ID
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getFriendsTimeline()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getFriendsTimelineByPage(int page)
throws TwitterException
page - the number of page
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getFriendsTimeline(java.lang.String id)
throws TwitterException
id - specifies the ID or screen name of the user for whom to return the friends_timeline
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getFriendsTimelineByPage(java.lang.String id,
int page)
throws TwitterException
id - specifies the ID or screen name of the user for whom to return the friends_timelinepage - the number of page
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getFriendsTimeline(java.util.Date since)
throws TwitterException
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getFriendsTimeline(java.lang.String id,
java.util.Date since)
throws TwitterException
id - specifies the ID or screen name of the user for whom to return the friends_timelinesince - narrows the returned results to just those statuses created after the specified HTTP-formatted date
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getUserTimeline(java.lang.String id,
int count,
java.util.Date since)
throws TwitterException
id - specifies the ID or screen name of the user for whom to return the user_timelinecount - specifies the number of statuses to retrieve. May not be greater than 20 for performance purposessince - narrows the returned results to just those statuses created after the specified HTTP-formatted date
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getUserTimeline(java.lang.String id,
java.util.Date since)
throws TwitterException
id - specifies the ID or screen name of the user for whom to return the user_timelinesince - narrows the returned results to just those statuses created after the specified HTTP-formatted date
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getUserTimeline(java.lang.String id,
int count)
throws TwitterException
id - specifies the ID or screen name of the user for whom to return the user_timelinecount - specifies the number of statuses to retrieve. May not be greater than 20 for performance purposes
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getUserTimeline(int count,
java.util.Date since)
throws TwitterException
count - specifies the number of statuses to retrieve. May not be greater than 20 for performance purposessince - narrows the returned results to just those statuses created after the specified HTTP-formatted date
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getUserTimeline(java.lang.String id)
throws TwitterException
id - specifies the ID or screen name of the user for whom to return the user_timeline
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getUserTimeline()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final Status show(int id)
throws TwitterException
id - the numerical ID of the status you're trying to retrieve
TwitterException - when Twitter service or network is unavailable
public Status update(java.lang.String status)
throws TwitterException
status - the text of your status update
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getReplies()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> getRepliesByPage(int page)
throws TwitterException
page - the number of page
TwitterException - when Twitter service or network is unavailable
public final java.util.List<User> getFriends()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<User> getFriends(int page)
throws TwitterException
page - number of page
TwitterException - when Twitter service or network is unavailable
public final java.util.List<User> getFriends(java.lang.String id)
throws TwitterException
id - the ID or screen name of the user for whom to request a list of friends
TwitterException - when Twitter service or network is unavailable
public final java.util.List<User> getFriends(java.lang.String id,
int page)
throws TwitterException
id - the ID or screen name of the user for whom to request a list of friendspage - the number of page
TwitterException - when Twitter service or network is unavailable
public final java.util.List<User> getFollowers()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<User> getFeatured()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final UserWithStatus getUserDetail(java.lang.String id)
throws TwitterException
id - the ID or screen name of the user for whom to request the detail
TwitterException - when Twitter service or network is unavailable
public final java.util.List<DirectMessage> getDirectMessages()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<DirectMessage> getDirectMessagesByPage(int page)
throws TwitterException
page - the number of page
TwitterException - when Twitter service or network is unavailable
public final java.util.List<DirectMessage> getDirectMessages(int sinceId)
throws TwitterException
sinceId - int
TwitterException - when Twitter service or network is unavailable
public final java.util.List<DirectMessage> getDirectMessages(java.util.Date since)
throws TwitterException
since - narrows the resulting list of direct messages to just those sent after the specified HTTP-formatted date
TwitterException - when Twitter service or network is unavailable
public final java.util.List<DirectMessage> getSentDirectMessages()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<DirectMessage> getSentDirectMessages(java.util.Date since)
throws TwitterException
since - narrows the resulting list of direct messages to just those sent after the specified HTTP-formatted date
TwitterException - when Twitter service or network is unavailable
public final java.util.List<DirectMessage> getSentDirectMessages(int sinceId)
throws TwitterException
sinceId - returns only sent direct messages with an ID greater than (that is, more recent than) the specified ID
TwitterException - when Twitter service or network is unavailable
public final DirectMessage sendDirectMessage(java.lang.String id,
java.lang.String text)
throws TwitterException
id - the ID or screen name of the user to whom send the direct messagetext - String
TwitterException - when Twitter service or network is unavailable
public final DirectMessage deleteDirectMessage(int id)
throws TwitterException
id - the ID of the direct message to destroy
TwitterException - when Twitter service or network is unavailable
public final User create(java.lang.String id)
throws TwitterException
id - the ID or screen name of the user to be befriended
TwitterException - when Twitter service or network is unavailable
public final User destroy(java.lang.String id)
throws TwitterException
id - the ID or screen name of the user for whom to request a list of friends
TwitterException - when Twitter service or network is unavailablepublic final boolean verifyCredentials()
public final java.util.List<Status> archive()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> archive(int page)
throws TwitterException
page - the number of page
TwitterException - when Twitter service or network is unavailable
public final User updateLocation(java.lang.String location)
throws TwitterException
location - the current location of the user
TwitterException - when Twitter service or network is unavailable
public final User updateDeliverlyDevice(twitter4j.Twitter.Device device)
throws TwitterException
device - new Delivery device. Must be one of: IM, SMS, NONE.
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> favorites()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> favorites(int page)
throws TwitterException
page - the number of page
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> favorites(java.lang.String id)
throws TwitterException
id - the ID or screen name of the user for whom to request a list of favorite statuses
TwitterException - when Twitter service or network is unavailable
public final java.util.List<Status> favorites(java.lang.String id,
int page)
throws TwitterException
id - the ID or screen name of the user for whom to request a list of favorite statusespage - the number of page
TwitterException - when Twitter service or network is unavailable
public final Status createFavorite(int id)
throws TwitterException
id - the ID of the status to favorite
TwitterException - when Twitter service or network is unavailable
public final Status destroyFavorite(int id)
throws TwitterException
id - the ID of the status to un-favorite
TwitterException - when Twitter service or network is unavailable
public final User follow(java.lang.String id)
throws TwitterException
id - String
TwitterException - when Twitter service or network is unavailable
public final User leave(java.lang.String id)
throws TwitterException
id - String
TwitterException - when Twitter service or network is unavailable
public final User block(java.lang.String id)
throws TwitterException
id - the ID or screen_name of the user to block
TwitterException - when Twitter service or network is unavailable
public final User unblock(java.lang.String id)
throws TwitterException
id - the ID or screen_name of the user to block
TwitterException - when Twitter service or network is unavailable
public final boolean test()
throws TwitterException
TwitterException - when Twitter service or network is unavailable
public final java.lang.String getDowntimeSchedule()
throws TwitterException
TwitterException - when Twitter service or network is unavailablepublic void setRetryCount(int retryCount)
public void setRetryIntervalSecs(int retryIntervalSecs)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||