|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwinterwell.jtwitter.Twitter_Users
public class Twitter_Users
API calls relating to users and relationships (the social network). Use
Twitter.users() to get one of these objects.
Conceptually, this is an extension of Twitter. The methods are here
because Twitter was getting crowded.
| Method Summary | |
|---|---|
User |
block(java.lang.String screenName)
blocks/create: Blocks screenName from following the authenticating user. |
User |
follow(java.lang.String username)
Start following a user. |
User |
follow(User user)
Convenience for follow(String) |
java.util.List<java.lang.Number> |
getBlockedIds()
|
java.util.List<User> |
getFeatured()
Returns a list of the users currently featured on the site with their current statuses inline. |
java.util.List<java.lang.Number> |
getFollowerIDs()
Returns the IDs of the authenticating user's followers. |
java.util.List<java.lang.Number> |
getFollowerIDs(java.lang.String screenName)
Returns the IDs of the specified user's followers. |
java.util.List<User> |
getFollowers()
Deprecated. Twitter advise using getFollowerIDs() and
show(Number) |
java.util.List<User> |
getFollowers(java.lang.String username)
Returns the (latest 100) given user's followers, each with current status inline. |
java.util.List<java.lang.Number> |
getFriendIDs()
Returns the IDs of the authenticating user's friends. |
java.util.List<java.lang.Number> |
getFriendIDs(java.lang.String screenName)
Returns the IDs of the specified user's friends. |
java.util.List<User> |
getFriends()
Deprecated. Twitter advise you to use getFriendIDs() with
Twitter_Users#showById(List) instead. |
java.util.List<User> |
getFriends(java.lang.String username)
Returns the (latest 100) given user's friends, each with current status inline. |
java.util.List<User> |
getRelationshipInfo(java.util.List<java.lang.String> screenNames)
Bulk-fetch relationship info by screen-name. |
java.util.List<User> |
getRelationshipInfoById(java.util.List<? extends java.lang.Number> userIDs)
Bulk-fetch relationship info by user-id. |
User |
getUser(long userId)
Synonym for #show(long). |
User |
getUser(java.lang.String screenName)
Synonym for show(String). |
boolean |
isBlocked(java.lang.Long userId)
|
boolean |
isBlocked(java.lang.String screenName)
|
boolean |
isFollower(java.lang.String userB)
Is the authenticating user followed by userB? |
boolean |
isFollower(java.lang.String followerScreenName,
java.lang.String followedScreenName)
|
boolean |
isFollowing(java.lang.String userB)
Does the authenticating user follow userB? |
boolean |
isFollowing(User user)
Convenience for isFollowing(String) |
User |
leaveNotifications(java.lang.String screenName)
Switches off notifications for updates from the specified user who must already be a friend. |
User |
notify(java.lang.String username)
Enables notifications for updates from the specified user who must already be a friend. |
User |
reportSpammer(java.lang.String screenName)
|
java.util.List<User> |
searchUsers(java.lang.String searchTerm)
Warning: there is a bug within twitter.com which means that location-based searches are treated as OR. |
java.util.List<User> |
show(java.util.List<java.lang.String> screenNames)
Lookup user info. |
User |
show(java.lang.Number userId)
Returns information of a given user, specified by user-id. |
User |
show(java.lang.String screenName)
Returns information of a given user, specified by screen name. |
java.util.List<User> |
showById(java.util.Collection<? extends java.lang.Number> userIds)
Lookup user info. |
User |
stopFollowing(java.lang.String username)
Destroy: Discontinues friendship with the user specified in the ID parameter as the authenticating user. |
User |
stopFollowing(User user)
Convenience for stopFollowing(String) |
User |
unblock(java.lang.String screenName)
blocks/destroy: Un-blocks screenName for the authenticating user. |
boolean |
userExists(java.lang.String screenName)
Does a user with the specified name or id exist? |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public User block(java.lang.String screenName)
screenName -
unblock(String)
public User follow(java.lang.String username)
throws TwitterException
username - Required. The ID or screen name of the user to befriend.
TwitterException - if the user does not exist or has been suspended.stopFollowing(String)public User follow(User user)
follow(String)
user -
public java.util.List<java.lang.Number> getBlockedIds()
showById(Collection) if you want to convert thse
into User objects.
public java.util.List<User> getFeatured()
throws TwitterException
Note: This is no longer part of the Twitter API. Support is provided via other methods.
TwitterException
public java.util.List<java.lang.Number> getFollowerIDs()
throws TwitterException
TwitterException
public java.util.List<java.lang.Number> getFollowerIDs(java.lang.String screenName)
throws TwitterException
The - screen name of the user whose followers are to be fetched.
TwitterException
@Deprecated
public java.util.List<User> getFollowers()
throws TwitterException
getFollowerIDs() and
show(Number)
TwitterException
public java.util.List<User> getFollowers(java.lang.String username)
throws TwitterException
username - The screen name of the user for whom to request a list of
friends.
TwitterException
public java.util.List<java.lang.Number> getFriendIDs()
throws TwitterException
TwitterException
public java.util.List<java.lang.Number> getFriendIDs(java.lang.String screenName)
throws TwitterException
The - screen name of the user whose friends are to be fetched.
TwitterException
@Deprecated
public java.util.List<User> getFriends()
throws TwitterException
getFriendIDs() with
Twitter_Users#showById(List) instead.
Note that there seems to be a small delay from Twitter in updates to this list.
TwitterExceptiongetFriendIDs(),
isFollowing(String)
public java.util.List<User> getFriends(java.lang.String username)
throws TwitterException
username - The screen name of the user for whom to request a list of
friends.
TwitterExceptionpublic java.util.List<User> getRelationshipInfo(java.util.List<java.lang.String> screenNames)
screenNames - Can be empty
User.isFollowingYou() and User.isFollowedByYou()
set (plus name, screenname and id).getRelationshipInfoById(List)public java.util.List<User> getRelationshipInfoById(java.util.List<? extends java.lang.Number> userIDs)
userIDs - Can be empty
User.isFollowingYou() and User.isFollowedByYou()
set (plus name, screenname and id).getRelationshipInfo(List)public User getUser(long userId)
#show(long). show is the Twitter API name, getUser
feels more Java-like.
userId - The user-id of a user.
getUser(String)public User getUser(java.lang.String screenName)
show(String). show is the Twitter API name, getUser
feels more Java-like.
screenName - The screen name of a user.
public boolean isBlocked(java.lang.Long userId)
public boolean isBlocked(java.lang.String screenName)
public boolean isFollower(java.lang.String userB)
userB - The screen name of a Twitter user.
public boolean isFollower(java.lang.String followerScreenName,
java.lang.String followedScreenName)
TwitterException.E403 - if one of the users has protected their updates and you don't
have access. This can be counter-intuitive (and annoying) at
times! Also throws E403 if one of the users has been
suspended (we use the TwitterException.SuspendedUser exception
sub-class for this).
TwitterException.E404 - if one of the users does not existpublic boolean isFollowing(java.lang.String userB)
userB - The screen name of a Twitter user.
public boolean isFollowing(User user)
isFollowing(String)
user - public User leaveNotifications(java.lang.String screenName)
screenName - Stop getting notifications from this user, who must already be
one of your friends.
public User notify(java.lang.String username)
username - Get notifications from this user, who must already be one of
your friends.
public User reportSpammer(java.lang.String screenName)
public java.util.List<User> searchUsers(java.lang.String searchTerm)
Unlike tweet search, this method does not support any operators. Only the first 1000 matches are available.
Does not do paging-to-max-results. But does support using
#setPageNumber(Integer), and #setMaxResults(int) for less
than the standard 20.
searchTerm -
public java.util.List<User> show(java.util.List<java.lang.String> screenNames)
screenNames - Can be empty (in which case we avoid wasting an API call)
#showById(List)public User show(java.lang.Number userId)
userId - The user-id of a user.
exception - if the user does not exist - or has been terminated (as
happens to spam bots).
public User show(java.lang.String screenName)
throws TwitterException,
TwitterException.SuspendedUser
screenName - The screen name of a user.
exception - if the user does not exist
TwitterException.SuspendedUser - if the user has been terminated (as happens to spam bots).
TwitterException#show(long)public java.util.List<User> showById(java.util.Collection<? extends java.lang.Number> userIds)
show(List), but works with Twitter
user-ID numbers. Done in batches of 100, limited to 1000 an hour.
userIds - . Can be empty (in which case we avoid making a wasted API
call).public User stopFollowing(java.lang.String username)
username - The screen name of the user with whom to discontinue
friendship.
public User stopFollowing(User user)
stopFollowing(String)
user -
public User unblock(java.lang.String screenName)
screenName -
block(String)public boolean userExists(java.lang.String screenName)
screenName - The screen name or user id of the suspected user.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||