winterwell.jtwitter
Class TwitterAccount

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

public class TwitterAccount
extends java.lang.Object

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

NB: These methods are here, rather than in the Twitter class, because the Twitter class is getting crowded.


Nested Class Summary
static class TwitterAccount.KAccessLevel
           
 
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
TwitterAccount(Twitter jtwit)
           
 
Method Summary
 Twitter.ITweet createSavedSearch(java.lang.String query)
          Create a new saved search.
 Twitter.ITweet destroySavedSearch(java.lang.Long id)
          Delete one of the user's saved searches!
 TwitterAccount.KAccessLevel getAccessLevel()
           
 java.util.List<Twitter.ITweet> getSavedSearches()
           
 Twitter.User setProfile(java.lang.String name, java.lang.String url, java.lang.String location, java.lang.String description)
          Update profile.
 Twitter.User setProfileColors(java.util.Map<java.lang.String,java.lang.String> colorName2hexCode)
          Set the authenticating user's colors.
 java.lang.String toString()
           
 Twitter.User verifyCredentials()
          Test the login credentials -- and get some user info.
 
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_TEXT

public static java.lang.String COLOR_TEXT

COLOR_LINK

public static java.lang.String COLOR_LINK

COLOR_SIDEBAR_FILL

public static java.lang.String COLOR_SIDEBAR_FILL

COLOR_SIDEBAR_BORDER

public static java.lang.String COLOR_SIDEBAR_BORDER
Constructor Detail

TwitterAccount

public TwitterAccount(Twitter jtwit)
Method Detail

toString

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

setProfile

public Twitter.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 Twitter.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

verifyCredentials

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

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

getAccessLevel

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

destroySavedSearch

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

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

createSavedSearch

public Twitter.ITweet createSavedSearch(java.lang.String query)
Create a new saved search.

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

getSavedSearches

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