winterwell.jtwitter
Class Twitter_Account

java.lang.Object
  extended by winterwell.jtwitter.Twitter_Account

public class Twitter_Account
extends java.lang.Object

Access the account methods: e.g. change your profile colours.

Note that user blocking/unblocking methods are in Twitter_Users -- see Twitter.users()


Nested Class Summary
static class Twitter_Account.KAccessLevel
           
static class Twitter_Account.Search
           
 
Field Summary
static java.lang.String COLOR_BG
           
static java.lang.String COLOR_LINK
           
static java.lang.String COLOR_SIDEBAR_BORDER
           
static java.lang.String COLOR_SIDEBAR_FILL
           
static java.lang.String COLOR_TEXT
           
 
Constructor Summary
Twitter_Account(Twitter jtwit)
           
 
Method Summary
 Twitter_Account.Search createSavedSearch(java.lang.String query)
          Create a new saved search.
 Twitter_Account.Search destroySavedSearch(java.lang.Long id)
          Delete one of the user's saved searches!
 Twitter_Account.KAccessLevel getAccessLevel()
           
 java.util.List<Twitter_Account.Search> getSavedSearches()
           
 User setProfile(java.lang.String name, java.lang.String url, java.lang.String location, java.lang.String description)
          Update profile.
 User setProfileColors(java.util.Map<java.lang.String,java.lang.String> colorName2hexCode)
          Set the authenticating user's colors.
 java.lang.String toString()
           
 User verifyCredentials()
          Test the login credentials -- and get some user info (which gets cached at Twitter.getSelf()).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLOR_BG

public static java.lang.String COLOR_BG

COLOR_LINK

public static java.lang.String COLOR_LINK

COLOR_SIDEBAR_BORDER

public static java.lang.String COLOR_SIDEBAR_BORDER

COLOR_SIDEBAR_FILL

public static java.lang.String COLOR_SIDEBAR_FILL

COLOR_TEXT

public static java.lang.String COLOR_TEXT
Constructor Detail

Twitter_Account

public Twitter_Account(Twitter jtwit)
Method Detail

createSavedSearch

public Twitter_Account.Search createSavedSearch(java.lang.String query)
Create a new saved search.

Parameters:
query - The search query
Returns:
the new search

destroySavedSearch

public Twitter_Account.Search destroySavedSearch(java.lang.Long id)
Delete one of the user's saved searches!

Parameters:
id - The id for this search
Returns:
the deleted search

getAccessLevel

public Twitter_Account.KAccessLevel getAccessLevel()
Returns:
What access level does this login have? If the login is bogus, this will return Twitter_Account.KAccessLevel.NONE.

getSavedSearches

public java.util.List<Twitter_Account.Search> getSavedSearches()
Returns:
The current user's saved searches on Twitter. Use Twitter.ITweet.getText() to retrieve the search query.

setProfile

public User setProfile(java.lang.String name,
                       java.lang.String url,
                       java.lang.String location,
                       java.lang.String description)
Update profile.

Parameters:
name - Can be null for no change. Full name associated with the profile. Maximum of 20 characters.
url - Can be null for no change. URL associated with the profile. Will be prepended with "http://" if not present. Maximum of 100 characters.
location - Can be null for no change. The city or country describing where the user of the account is located. The contents are not normalized or geocoded in any way. Maximum of 30 characters.
description - Can be null for no change. A description of the user. Maximum of 160 characters.
Returns:
updated User object

setProfileColors

public User setProfileColors(java.util.Map<java.lang.String,java.lang.String> colorName2hexCode)
Set the authenticating user's colors.

Parameters:
colorName2hexCode - Use the COLOR_XXX constants as keys, and 3 or 6 letter hex-codes as values (e.g. 0f0 or 00ff00 both code for green). You can set as many colors as you like (but at least one).
Returns:
updated User object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

verifyCredentials

public User verifyCredentials()
                       throws TwitterException.E401
Test the login credentials -- and get some user info (which gets cached at Twitter.getSelf()).

Returns:
a representation of the requesting user if authentication was successful
Throws:
TwitterException.E401 - thrown if the authorisation credentials fail.
See Also:
Twitter.isValidLogin()