net.asplode.tumblr
Class Tumblr
java.lang.Object
net.asplode.tumblr.Tumblr
public class Tumblr
- extends java.lang.Object
- Author:
- nsheridan
Constructor Summary |
Tumblr(java.lang.String oauth_key,
java.lang.String oauth_secret)
|
Method Summary |
org.json.JSONObject |
deletePost(java.lang.String id)
|
org.json.JSONObject |
follow(java.lang.String blogURL)
|
org.json.JSONObject |
getAvatar()
|
org.json.JSONObject |
getAvatar(int size)
|
org.json.JSONObject |
getBlogInfo()
|
org.json.JSONObject |
getDashboard(boolean notes)
|
org.json.JSONObject |
getDashboard(boolean notes,
int offset)
|
org.json.JSONObject |
getDrafts()
|
org.json.JSONObject |
getFollowers()
|
org.json.JSONObject |
getFollowing()
|
org.json.JSONObject |
getFollowing(int offset)
|
org.json.JSONObject |
getLikes()
|
org.json.JSONObject |
getLikes(int offset)
|
org.json.JSONObject |
getPost(java.lang.String postid,
boolean notes)
|
org.json.JSONObject |
getPosts(boolean notes)
|
org.json.JSONObject |
getPosts(boolean notes,
int offset)
|
org.json.JSONObject |
getQueue()
|
org.json.JSONObject |
getUserInfo()
|
org.json.JSONObject |
likePost(java.lang.String id,
java.lang.String reblog_key)
|
void |
setBlog(java.lang.String blog)
|
void |
setCredentials(java.lang.String email,
java.lang.String password)
|
org.json.JSONObject |
unfollow(java.lang.String blogURL)
|
org.json.JSONObject |
unlikePost(java.lang.String id,
java.lang.String reblog_key)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Tumblr
public Tumblr(java.lang.String oauth_key,
java.lang.String oauth_secret)
- Parameters:
oauth_key
- OAuth key.oauth_secret
- OAuth secret key.
setCredentials
public void setCredentials(java.lang.String email,
java.lang.String password)
- Parameters:
email
- Email addresspassword
- Password
setBlog
public void setBlog(java.lang.String blog)
- Parameters:
blog
- Blog url e.g. "myblog.tumblr.com", "tumblr.mydomain.com"
getBlogInfo
public org.json.JSONObject getBlogInfo()
throws NoBlogException,
org.apache.http.client.ClientProtocolException,
java.io.IOException,
java.lang.IllegalStateException,
org.json.JSONException
- Returns:
- Blog info
- Throws:
NoBlogException
org.apache.http.client.ClientProtocolException
java.io.IOException
java.lang.IllegalStateException
org.json.JSONException
getAvatar
public org.json.JSONObject getAvatar()
throws NoBlogException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Returns:
- Blog avatar, 64x64
- Throws:
NoBlogException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getAvatar
public org.json.JSONObject getAvatar(int size)
throws NoBlogException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
size
- Size of avatar. 16, 24, 30, 40, 48, 64, 96, 128, 512.
- Returns:
- Avatar of requested size.
- Throws:
NoBlogException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getFollowers
public org.json.JSONObject getFollowers()
throws NoBlogException,
oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Returns:
- Followers
- Throws:
NoBlogException
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getPosts
public org.json.JSONObject getPosts(boolean notes)
throws NoBlogException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
notes
- Include note count and note metadata
- Returns:
- Posts
- Throws:
NoBlogException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getPosts
public org.json.JSONObject getPosts(boolean notes,
int offset)
throws NoBlogException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
notes
- Include note count and note metadataoffset
- Post number to start at
- Returns:
- Posts
- Throws:
NoBlogException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getPost
public org.json.JSONObject getPost(java.lang.String postid,
boolean notes)
throws NoBlogException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
postid
- Post IDnotes
- Include note count and note metadata
- Returns:
- Specific post
- Throws:
NoBlogException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getQueue
public org.json.JSONObject getQueue()
throws NoBlogException,
oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Returns:
- Posts in the queue
- Throws:
NoBlogException
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getDrafts
public org.json.JSONObject getDrafts()
throws NoBlogException,
oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Returns:
- Draft posts
- Throws:
NoBlogException
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
deletePost
public org.json.JSONObject deletePost(java.lang.String id)
throws NoBlogException,
oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
id
- Post ID to delete.
- Returns:
- Status of the request
- Throws:
NoBlogException
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getUserInfo
public org.json.JSONObject getUserInfo()
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Returns:
- User info
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getDashboard
public org.json.JSONObject getDashboard(boolean notes)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
notes
- Include note count and note metadata
- Returns:
- Dashboard
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getDashboard
public org.json.JSONObject getDashboard(boolean notes,
int offset)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
notes
- Include note count and note metadataoffset
- Post number to start at.
- Returns:
- Dashboard
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getLikes
public org.json.JSONObject getLikes()
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Returns:
- Liked posts
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getLikes
public org.json.JSONObject getLikes(int offset)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
offset
- Post number to start at
- Returns:
- Liked posts
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getFollowing
public org.json.JSONObject getFollowing()
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Returns:
- Blogs the user is following
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
getFollowing
public org.json.JSONObject getFollowing(int offset)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
offset
- Post number to start at
- Returns:
- Blogs the user is following
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
follow
public org.json.JSONObject follow(java.lang.String blogURL)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
blogURL
- URL of the blog to follow
- Returns:
- Status of the request
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
unfollow
public org.json.JSONObject unfollow(java.lang.String blogURL)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
blogURL
- URL of the blog to unfollow
- Returns:
- Status of the request
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
likePost
public org.json.JSONObject likePost(java.lang.String id,
java.lang.String reblog_key)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
id
- Post IDreblog_key
- Post reblog key
- Returns:
- Status of the request
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException
unlikePost
public org.json.JSONObject unlikePost(java.lang.String id,
java.lang.String reblog_key)
throws oauth.signpost.exception.OAuthMessageSignerException,
oauth.signpost.exception.OAuthExpectationFailedException,
oauth.signpost.exception.OAuthCommunicationException,
org.apache.http.client.ClientProtocolException,
java.lang.IllegalStateException,
java.io.IOException,
org.json.JSONException
- Parameters:
id
- Post IDreblog_key
- Post reblog key
- Returns:
- Status of the request
- Throws:
oauth.signpost.exception.OAuthMessageSignerException
oauth.signpost.exception.OAuthExpectationFailedException
oauth.signpost.exception.OAuthCommunicationException
org.apache.http.client.ClientProtocolException
java.lang.IllegalStateException
java.io.IOException
org.json.JSONException