public class Twitter_Account
extends java.lang.Object
Note that user blocking/unblocking methods are in
Twitter_Users
-- see Twitter.users()
Modifier and Type | Class and Description |
---|---|
static class |
Twitter_Account.KAccessLevel
The access level is set for the application as a whole!
If you want different levels, make several applications.
|
static class |
Twitter_Account.Search |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Twitter_Account(Twitter jtwit) |
Modifier and Type | Method and Description |
---|---|
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()
Deprecated.
It seems Twitter have stopped sending this info! Expect null from this method.
|
java.util.Map<java.lang.String,RateLimit> |
getRateLimits()
Call Twitter to fetch rate-limit info.
|
java.util.List<Twitter_Account.Search> |
getSavedSearches() |
void |
removeProfileBanner()
See setProfileBanner - don't expect a useful response, just "OK" or error
|
User |
setProfile(java.lang.String name,
java.lang.String url,
java.lang.String location,
java.lang.String description)
Update profile.
|
void |
setProfileBanner(java.io.File image)
See https://dev.twitter.com/rest/reference/post/account/update_profile_banner
NB: The API supports cropping, but we have not implemented this yet.
|
User |
setProfileColors(java.util.Map<java.lang.String,java.lang.String> colorName2hexCode)
Set the authenticating user's colors.
|
User |
setProfileDescription(java.lang.String description)
Convenience method for
setProfile(String, String, String, String) |
User |
setProfileImage(java.io.File image)
See https://dev.twitter.com/rest/reference/post/account/update_profile_image.
|
User |
setProfileLink(java.lang.String url)
Convenience method for
setProfile(String, String, String, String) |
User |
setProfileLocation(java.lang.String locn)
Convenience method for
setProfile(String, String, String, String) |
java.lang.String |
toString() |
User |
verifyCredentials()
Test the login credentials -- and get some user info (which gets cached
at
Twitter.getSelf() ). |
public static java.lang.String COLOR_BG
public static java.lang.String COLOR_LINK
public static java.lang.String COLOR_SIDEBAR_BORDER
public static java.lang.String COLOR_SIDEBAR_FILL
public static java.lang.String COLOR_TEXT
public Twitter_Account(Twitter jtwit)
public java.util.Map<java.lang.String,RateLimit> getRateLimits()
Twitter.IHttpClient.getRateLimits()
public Twitter_Account.Search createSavedSearch(java.lang.String query)
query
- The search querypublic Twitter_Account.Search destroySavedSearch(java.lang.Long id)
id
- The id for this searchpublic Twitter_Account.KAccessLevel getAccessLevel()
Twitter_Account.KAccessLevel.NONE
.public java.util.List<Twitter_Account.Search> getSavedSearches()
Twitter.ITweet.getText()
to retrieve the search query.public User setProfile(java.lang.String name, java.lang.String url, java.lang.String location, java.lang.String description)
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.public User setProfileDescription(java.lang.String description)
setProfile(String, String, String, String)
description
- public User setProfileLink(java.lang.String url)
setProfile(String, String, String, String)
description
- public User setProfileLocation(java.lang.String locn)
setProfile(String, String, String, String)
description
- public User setProfileImage(java.io.File image)
image
- gif, jpg, or png <700k. Larger images will be scaled by Twitter.
Use a square image! Otherwise Twitter will crop it ruthlessly.public void setProfileBanner(java.io.File image)
image
- public void removeProfileBanner()
public User setProfileColors(java.util.Map<java.lang.String,java.lang.String> colorName2hexCode)
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).public java.lang.String toString()
toString
in class java.lang.Object
public User verifyCredentials() throws TwitterException.E401
Twitter.getSelf()
).TwitterException.E401
- thrown if the authorisation credentials fail.Twitter.isValidLogin()