Documentation ¶
Index ¶
- type AltSize
- type AnswerPost
- type AudioPost
- type AvatarResponse
- type BasePost
- type BlogInfo
- type BlogInfoResponse
- type ChatPost
- type Client
- func (c *Client) Avatar(blogname string, size int) (AvatarResponse, error)
- func (c *Client) BlogInfo(blogname string) (BlogInfoResponse, error)
- func (c *Client) BlogLikes(blogname string, options url.Values) (LikesResponse, error)
- func (c *Client) CreateAudio(blogname string, options url.Values) error
- func (c *Client) CreateChatPost(blogname string, options url.Values) error
- func (c *Client) CreateLink(blogname string, options url.Values) error
- func (c *Client) CreatePhoto(blogname string, options url.Values) error
- func (c *Client) CreateQuote(blogname string, options url.Values) error
- func (c *Client) CreateText(blogname string, options url.Values) error
- func (c *Client) CreateVideo(blogname string, options url.Values) error
- func (c *Client) Dashboard(options url.Values) (DraftsResponse, error)
- func (c *Client) DeletePost(blogname, id string) error
- func (c *Client) Drafts(blogname string, options url.Values) (DraftsResponse, error)
- func (c *Client) EditPost(blogname string, options url.Values) error
- func (c *Client) Follow(blogname string) error
- func (c *Client) Followers(blogname string, options url.Values) (FollowersResponse, error)
- func (c *Client) Following(options url.Values) (FollowingResponse, error)
- func (c *Client) Get(requestURL string, values url.Values) (CompleteResponse, error)
- func (c *Client) Info() (UserInfoResponse, error)
- func (c *Client) Like(id, reblogKey string) error
- func (c *Client) Likes(options url.Values) (LikesResponse, error)
- func (c *Client) Notes(blogname, postID string, options url.Values) (NotesResponse, error)
- func (c *Client) Post(requestURL string, values url.Values) (CompleteResponse, error)
- func (c *Client) Posts(blogname, postsType string, options url.Values) (PostsResponse, error)
- func (c *Client) Queue(blogname string, options url.Values) (DraftsResponse, error)
- func (c *Client) Reblog(blogname string, options url.Values) error
- func (c *Client) Submission(blogname string, options url.Values) (DraftsResponse, error)
- func (c *Client) Tagged(tag string, options url.Values) ([]json.RawMessage, error)
- func (c *Client) Unfollow(blogname string) error
- func (c *Client) Unlike(id, reblogKey string) error
- type CompleteResponse
- type DialogueInfo
- type DraftsResponse
- type FollowedBlog
- type FollowersResponse
- type FollowingResponse
- type LikesResponse
- type LinkPost
- type MetaInfo
- type Note
- type NotesResponse
- type OwnedBlog
- type PhotoObject
- type PhotoPost
- type PlayerInfo
- type PostsResponse
- type QuotePost
- type ReblogComment
- type Setter
- type TextPost
- type User
- type UserInfo
- type UserInfoResponse
- type VideoPost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnswerPost ¶
type AudioPost ¶
type AudioPost struct { BasePost Caption string `json:"caption"` Player string `json:"player"` Plays int64 `json:"plays"` AlbumArt string `json:"album_art"` Artist string `json:"artist"` Album string `json:"album"` TrackName string `json:"track_name"` TrackNumber int64 `json:"track_number"` Year int64 `json:"year"` }
type AvatarResponse ¶
type AvatarResponse struct {
AvatarURL string `json:"avatar_url"`
}
type BasePost ¶
type BasePost struct { BlogName string `json:"blog_name"` ID json.Number `json:"id"` PostURL string `json:"post_url"` PostType string `json:"type"` Timestamp int64 `json:"timestamp"` Date string `json:"date"` Format string `json:"format"` ReblogKey string `json:"reblog_key"` Tags []string `json:"tags"` Bookmarklet bool `json:"bookmarklet"` Mobile bool `json:"mobile"` SourceURL string `json:"source_url"` SourceTitle string `json:"source_title"` Liked bool `json:"liked"` State string `json:"state"` TotalPosts int64 `json:"total_posts"` NoteCount int64 `json:"note_count"` Notes []Note `json:"notes"` Reblog ReblogComment `json:"reblog"` RebloggedFromID json.Number `json:"reblogged_from_id"` RebloggedFromURL string `json:"reblogged_from_url"` RebloggedFromName string `json:"reblogged_from_name"` RebloggedFromTitle string `json:"reblogged_from_title"` RebloggedFromUUID string `json:"reblogged_from_uuid"` RebloggedFromCanMessage bool `json:"reblogged_from_can_message"` RebloggedRootID json.Number `json:"reblogged_root_id"` RebloggedRootURL string `json:"reblogged_root_url"` RebloggedRootName string `json:"reblogged_root_name"` RebloggedRootTitle string `json:"reblogged_root_title"` RebloggedRootUUID string `json:"reblogged_root_uuid"` RebloggedRootCanMessage bool `json:"reblogged_root_can_message"` }
type BlogInfoResponse ¶
type BlogInfoResponse struct {
Blog BlogInfo `json:"blog"`
}
type ChatPost ¶
type ChatPost struct { BasePost Title string `json:"title"` Body string `json:"body"` Dialogue []DialogueInfo `json:"dialogue"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines a Go Client for the Tumblr API.
func New ¶
New initializes the Client. consumerKey is the consumer key of your Tumblr Application. consumerSecret is the consumer secret of your Tumblr Application. oauthToken is the user specific token, received from the /access_token endpoint. oauthSecret is the user specific secret, received from the /access_token endpoint. host is the host that you are tryng to send information to (e.g. https://api.tumblr.com).
func (*Client) Avatar ¶
func (c *Client) Avatar(blogname string, size int) (AvatarResponse, error)
Avatar retrieves the url of the blog's avatar. size can be: 16, 24, 30, 40, 48, 64, 96, 128 or 512.
func (*Client) BlogInfo ¶
func (c *Client) BlogInfo(blogname string) (BlogInfoResponse, error)
BlogInfo gets general information about the blog. blogname: name of the blog you want to get information about(e.g. mgterzieva.tumblr.com).
func (*Client) BlogLikes ¶
BlogLikes gets the likes of blog given. blogname: name of the blog whose likes you want to get. options can be: limit: how many likes do you want to get; offset: the number of the like you want to start from.
func (*Client) CreateAudio ¶
CreateAudio creates an audio post on a blog. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) state: the state of the post(e.g. published, draft, queue, private); tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; caption: the caption of the post; *externalURL: the url of the site that hosts the audio file.
func (*Client) CreateChatPost ¶
CreateChatPost creates a chat post on a blog. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) state: the state of the post(e.g. published, draft, queue, private); tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; title: the title of the chat; *conversation: the text of the conversation/chat, with dialogue labels.
func (*Client) CreateLink ¶
CreateLink creates a link post on a blog. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) state: the state of the post(e.g. published, draft, queue, private); tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; title: the title of the page the link points to; *url: the link you are posting; description: the description of the link you are posting.
func (*Client) CreatePhoto ¶
CreatePhoto creates a photo post or photoset on a blog. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) state: the state of the post(e.g. published, draft, queue, private); tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; caption: the caption that you want applied to the photo; link: the 'click-through' url for the photo; *source: the photo source url.
func (*Client) CreateQuote ¶
CreateQuote creates a quote post on a blog. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) state: the state of the post(e.g. published, draft, queue, private); tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; *quote: the full text of the quote; source: the cited source of the quote.
func (*Client) CreateText ¶
CreateText creates a text post on a blog. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) state: the state of the post(e.g. published, draft, queue, private); tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; title: the optional title of the post; *body: the full text body.
func (*Client) CreateVideo ¶
CreateVideo creates a video post on a blog. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) state: the state of the post(e.g. published, draft, queue, private); tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; caption: the caption for the post; *embed: the html embed code for the video.
func (*Client) Dashboard ¶
func (c *Client) Dashboard(options url.Values) (DraftsResponse, error)
Dashboard gets the dashboard of the user. options can be: limit: number of results to return; offset: post number to start at; type: the type of posts to return(text, photo, quote, link, chat, audio, video, answer); sinceID: return posts that have apeared after this id; reblog_info: whether to return reblog information about the posts; notes_info: whether to return notes information about the posts.
func (*Client) DeletePost ¶
DeletePost deletes a post with a given id. blogname: the url of the blog you want to delete from. id: the id of the post you want to delete.
func (*Client) Drafts ¶
Drafts gets posts that are currently in the blog's drafts. options can be: filter: specify posts' format(e.g. format="html", format="text", format="raw").
func (*Client) EditPost ¶
EditPost edits a post with a given id. blogname: the url of the blog you want to post to. options can be: (with * are marked required options) tags: a list of tags you want applied to the post; tweet: manages the autotweet for this post: set to off for no tweet or enter text to override the default tweet; date: the GMT date and time of the post as a string; format: sets the format type of the post(html or markdown); slug: add a short text summary to the end of the post url; *id: the id of the post. The other options are specific to the type of post you want to edit.
func (*Client) Followers ¶
Followers gets the followers of the blog given. blogname: name of the blog whose followers you want to get. optons can be: limit: the number of results to return, inclusive; offset: result to start at.
func (*Client) Following ¶
func (c *Client) Following(options url.Values) (FollowingResponse, error)
Following gets the blogs that the user is following. options can be: limit: the number of results to return; offset: result number to start at.
func (*Client) Get ¶
Get makes a GET request to the API with properly formatted parameters. requestURL: the url you are making the request to. values: the parameters needed for the request.
func (*Client) Info ¶
func (c *Client) Info() (UserInfoResponse, error)
Info gets the user information.
func (*Client) Like ¶
Like post of a given blog. id: the id of the post you want to like. reblog_key: the reblog key for the post id.
func (*Client) Likes ¶
func (c *Client) Likes(options url.Values) (LikesResponse, error)
Likes gets the likes of the given user. options can be: limit: the number of results to return, inclusive; offset: liked post number to start at.
func (*Client) Notes ¶
Notes gets a list of notes on a post. options can be: mode: likes, reblogs_with_tags or rollup before_timestamp: return only notes created before the given timestamp
func (*Client) Post ¶
Post makes a POST request to the API, allows for multipart data uploads. requestURL: the url you are making the request to. values: all the parameters needed for the request.
func (*Client) Posts ¶
Posts gets a list of posts from a blog. blogname: the name of the blog you want to get posts from (e.g. mgterzieva.tumblr.com). postsType: the type of the posts you want to get (e.g. text, quote, link, answer, video, audio, photo, chat, all). options can be: id: the id of the post you are looking for; tag: return only posts with this tag; limit: the number of posts to return; offset: the number of the post you want to start from; filter: return only posts with a specific format(e.g. html, text, raw).
func (*Client) Queue ¶
Queue gets posts that are currently in the blog's queue. options can be: limit: the number of results to return; offset: post number to start at; filter: specify posts' format(e.g. format="html", format="text", format="raw").
func (*Client) Reblog ¶
Reblog creates a reblog on the given blog. blogname: the url of the blog you want to reblog to. options should be: (with * are marked required options) *id: the id of the reblogged post; *reblog_key: the reblog key of the rebloged post.
func (*Client) Submission ¶
Submission retrieve submission posts. options can be: offset: post number to start at; filter: specify posts' format(e.g. format="html", format="text", format="raw").
func (*Client) Tagged ¶
Tagged gets a list of posts with the given tag. tag: the tag you want to look for. options can be: before: the timestamp of when you'd like to see posts before; limit: the number of results to return; filter: the post format you want to get(e.g html, text, raw).
type CompleteResponse ¶
type CompleteResponse struct { Meta MetaInfo `json:"meta"` Response json.RawMessage `json:"response"` }
type DialogueInfo ¶
type DraftsResponse ¶
type DraftsResponse struct {
Posts []json.RawMessage `json:"posts"`
}
type FollowedBlog ¶
type FollowersResponse ¶
type FollowingResponse ¶
type FollowingResponse struct { TotalBlogs int64 `json:"total_blogs"` Blogs []FollowedBlog `json:"blogs"` }
type LikesResponse ¶
type LikesResponse struct { LikedPosts []json.RawMessage `json:"liked_posts"` LikedCount int64 `json:"liked_count"` }
type Note ¶
type Note struct { Type string `json:"type"` Timestamp int64 `json:"timestamp"` BlogName string `json:"blog_name"` BlogUUID string `json:"blog_uuid"` BlogURL string `json:"blog_url"` Followed bool `json:"followed"` AvatarShape string `json:"avatar_shape"` ReplyText string `json:"reply_text"` PostID json.Number `json:"post_id"` ReblogParentBlogName string `json:"reblog_parent_blog_name"` }
type NotesResponse ¶
type NotesResponse struct {
Notes []Note `json:"notes"`
}
type PhotoObject ¶
type PhotoPost ¶
type PhotoPost struct { BasePost Photos []PhotoObject `json:"photos"` Caption string `json:"caption"` Width int64 `json:"width"` Height int64 `json:"height"` }
type PlayerInfo ¶
type PostsResponse ¶
type PostsResponse struct { Blog BlogInfo `json:"blog"` Posts []json.RawMessage `json:"posts"` TotalPosts int64 `json:"total_posts"` }
type ReblogComment ¶
type Setter ¶
type Setter func(*Client)
Setter funcs are executed at the end of NewClient.
func SetHeaders ¶
SetHeaders sets headers that are send with every request.
type UserInfoResponse ¶
type UserInfoResponse struct {
User UserInfo `json:"user"`
}
type VideoPost ¶
type VideoPost struct { BasePost Caption string `json:"caption"` Player []PlayerInfo `json:"player"` }
Source Files ¶
- avatar_response.go
- base_post.go
- blog.go
- bloginfo_response.go
- complete_response.go
- drafts_response.go
- followed_blog.go
- followers_response.go
- following_response.go
- gotumblr.go
- likes_response.go
- meta.go
- notes_response.go
- owned_blog.go
- post_types.go
- posts_response.go
- request.go
- user.go
- userinfo.go
- userinfo_response.go