twitter4j.api
Interface UserMethods

All Known Subinterfaces:
Twitter

public interface UserMethods

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 ResponseList<User> getMemberSuggestions(String categorySlug)
          Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.
 ProfileImage getProfileImage(String screenName, ProfileImage.ImageSize size)
          Access the profile image in various sizes for the user with the indicated screen_name.
 ResponseList<Category> getSuggestedUserCategories()
          Access to Twitter's suggested user list.
 ResponseList<User> getUserSuggestions(String categorySlug)
          Access the users in a given category of the Twitter suggested user list.
It is recommended that end clients cache this data for no more than one hour.
 ResponseList<User> lookupUsers(long[] ids)
          Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
 ResponseList<User> lookupUsers(String[] screenNames)
          Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
 ResponseList<User> searchUsers(String query, int page)
          Run a search for users similar to the Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API.
Usage note: It is only possible to retrieve the first 1000 matches from this API.
 User showUser(long userId)
          Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
 User showUser(String screenName)
          Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
 

Method Detail

showUser

User showUser(String screenName)
              throws TwitterException
Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.
This method calls http://api.twitter.com/1/users/show.json

Parameters:
screenName - the screen name of the user for whom to request the detail
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/show | Twitter Developers

showUser

User showUser(long userId)
              throws TwitterException
Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.
This method calls http://api.twitter.com/1/users/show.json

Parameters:
userId - the ID of the user for whom to request the detail
Returns:
users
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
GET users/show | Twitter Developers

lookupUsers

ResponseList<User> lookupUsers(String[] screenNames)
                               throws TwitterException
Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.
This method calls http://api.twitter.com/1/users/lookup.json

Parameters:
screenNames - Specifies the screen names of the users to return.
Returns:
users
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.1
See Also:
GET users/lookup | Twitter Developers

lookupUsers

ResponseList<User> lookupUsers(long[] ids)
                               throws TwitterException
Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.
This method calls http://api.twitter.com/1/users/lookup.json

Parameters:
ids - Specifies the screen names of the users to return.
Returns:
users
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.1
See Also:
GET users/lookup | Twitter Developers

searchUsers

ResponseList<User> searchUsers(String query,
                               int page)
                               throws TwitterException
Run a search for users similar to the Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API.
Usage note: It is only possible to retrieve the first 1000 matches from this API.
This method calls http://api.twitter.com/1/users/search.json

Parameters:
query - The query to run against people search.
page - Specifies the page of results to retrieve. Number of statuses per page is fixed to 20.
Returns:
the list of Users matches the provided
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/search | Twitter Developers

getSuggestedUserCategories

ResponseList<Category> getSuggestedUserCategories()
                                                  throws TwitterException
Access to Twitter's suggested user list. This returns the list of suggested user categories. The category can be used in the users/suggestions/category endpoint to get the users in that category.
This method calls http://api.twitter.com/1/users/suggestions/:slug.json

Returns:
list of suggested user categories.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.1
See Also:
GET users/suggestions/:slug | Twitter Developers

getUserSuggestions

ResponseList<User> getUserSuggestions(String categorySlug)
                                      throws TwitterException
Access the users in a given category of the Twitter suggested user list.
It is recommended that end clients cache this data for no more than one hour.
This method calls http://api.twitter.com/1/users/suggestions/:slug.json

Parameters:
categorySlug - slug
Returns:
list of suggested users
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.1
See Also:
GET users/suggestions/slug | Twitter Developers

getMemberSuggestions

ResponseList<User> getMemberSuggestions(String categorySlug)
                                        throws TwitterException
Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/users/suggestions/:slug/members.json

Parameters:
categorySlug - slug
Returns:
list of suggested users
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.9
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getProfileImage

ProfileImage getProfileImage(String screenName,
                             ProfileImage.ImageSize size)
                             throws TwitterException
Access the profile image in various sizes for the user with the indicated screen_name. If no size is provided the normal image is returned. This resource does not return JSON or XML, but instead returns a 302 redirect to the actual image resource. This method should only be used by application developers to lookup or check the profile image URL for a user. This method must not be used as the image source URL presented to users of your application.
This method calls http://api.twitter.com/1/users/profile_image/:screen_name.json

Parameters:
screenName - The screen name of the user for whom to return results for.
size - Specifies the size of image to fetch. Not specifying a size will give the default, normal size of 48px by 48px. Valid options include: BIGGER - 73px by 73px NORMAL - 48px by 48px MINI - 24px by 24px
Returns:
profile image
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.7
See Also:
GET users/profile_image/:screen_name | Twitter Developers


Copyright © 2012. All Rights Reserved.