gotumblr: github.com/MariaTerzieva/gotumblr Index | Files

package gotumblr

import "github.com/MariaTerzieva/gotumblr"

Index

Package 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 owned_blog.go post_types.go posts_response.go request.go user.go userinfo.go userinfo_response.go

type AltSize Uses

type AltSize struct {
    Width, Height int64
    Url           string
}

type AnswerPost Uses

type AnswerPost struct {
    BasePost
    Asking_name string
    Asking_url  string
    Question    string
    Answer      string
}

type AudioPost Uses

type AudioPost struct {
    BasePost
    Caption      string
    Player       string
    Plays        int64
    Album_art    string
    Artist       string
    Album        string
    Track_name   string
    Track_number int64
    Year         int64
}

type AvatarResponse Uses

type AvatarResponse struct {
    Avatar_url string
}

type BasePost Uses

type BasePost struct {
    Blog_name    string
    Id           int64
    Post_url     string
    PostType     string `json:"type"`
    Timestamp    int64
    Date         string
    Format       string
    Reblog_key   string
    Tags         []string
    Bookmarklet  bool
    Mobile       bool
    Source_url   string
    Source_title string
    Liked        bool
    State        string
    Total_Posts  int64
    Note_count   int64
    Notes        []Note
}

type BlogInfo Uses

type BlogInfo struct {
    Title       string
    Posts       int64
    Name        string
    Url         string
    Updated     int64
    Description string
    Ask         bool
    Ask_anon    bool
    Likes       int64
}

type BlogInfoResponse Uses

type BlogInfoResponse struct {
    Blog BlogInfo
}

type ChatPost Uses

type ChatPost struct {
    BasePost
    Title, Body string
    Dialogue    []DialogueInfo
}

type CompleteResponse Uses

type CompleteResponse struct {
    Meta     MetaInfo
    Response json.RawMessage
}

type DialogueInfo Uses

type DialogueInfo struct {
    Name, Label, Phrase string
}

type DraftsResponse Uses

type DraftsResponse struct {
    Posts []json.RawMessage
}

type FollowedBlog Uses

type FollowedBlog struct {
    Name        string
    Url         string
    Updated     int64
    Title       string
    Description string
}

type FollowersResponse Uses

type FollowersResponse struct {
    Total_users int64
    Users       []User
}

type FollowingResponse Uses

type FollowingResponse struct {
    Total_blogs int64
    Blogs       []FollowedBlog
}

type LikesResponse Uses

type LikesResponse struct {
    Liked_posts []json.RawMessage
    Liked_count int64
}

type LinkPost Uses

type LinkPost struct {
    BasePost
    Title, Url, Description string
}

type MetaInfo Uses

type MetaInfo struct {
    Status int64
    Msg    string
}

type Note Uses

type Note struct {
    Type                    string
    Timestamp               int64
    Blog_name               string
    Blog_uuid               string
    Blog_url                string
    Followed                bool
    Avatar_shape            string
    Post_id                 string
    Reblog_parent_blog_name string
}

type OwnedBlog Uses

type OwnedBlog struct {
    Name      string
    Url       string
    Title     string
    Primary   bool
    Followers int64
    Tweet     string
    Facebook  string
    Type      string
}

type PhotoObject Uses

type PhotoObject struct {
    Caption   string
    Alt_sizes []AltSize
}

type PhotoPost Uses

type PhotoPost struct {
    BasePost
    Photos        []PhotoObject
    Caption       string
    Width, Height int64
}

type PlayerInfo Uses

type PlayerInfo struct {
    Width      int64
    Embed_code string
}

type PostsResponse Uses

type PostsResponse struct {
    Blog        BlogInfo
    Posts       []json.RawMessage
    Total_posts int64
}

type QuotePost Uses

type QuotePost struct {
    BasePost
    Text, Source string
}

type TextPost Uses

type TextPost struct {
    BasePost
    Title, Body string
}

type TumblrRequest Uses

type TumblrRequest struct {
    // contains filtered or unexported fields
}

Make queries to the Tumblr API through TumblrRequest.

func NewTumblrRequest Uses

func NewTumblrRequest(consumerKey, consumerSecret, oauthToken, oauthSecret, callbackUrl, host string) *TumblrRequest

Initializes the TumblrRequest. consumerKey is the consumer key of your Tumblr Application. consumerSecret is the consumer secret of your Tumblr Application. callbackUrl is the callback URL 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. http://api.tumblr.com).

func (*TumblrRequest) Get Uses

func (tr *TumblrRequest) Get(requestUrl string, params map[string]string) CompleteResponse

Make a GET request to the API with properly formatted parameters. requestUrl: the url you are making the request to. params: the parameters needed for the request.

func (*TumblrRequest) JSONParse Uses

func (tr *TumblrRequest) JSONParse(content []byte) CompleteResponse

Parse JSON response. content: the content returned from the web request to be parsed as JSON.

func (*TumblrRequest) Post Uses

func (tr *TumblrRequest) Post(requestUrl string, params map[string]string) CompleteResponse

Makes a POST request to the API, allows for multipart data uploads. requestUrl: the url you are making the request to. params: all the parameters needed for the request.

type TumblrRestClient Uses

type TumblrRestClient struct {
    // contains filtered or unexported fields
}

defines a Go Client for the Tumblr API.

func NewTumblrRestClient Uses

func NewTumblrRestClient(consumerKey, consumerSecret, oauthToken, oauthSecret, callbackUrl, host string) *TumblrRestClient

Initializes the TumblrRestClient, creating TumblrRequest that deals with all request formatting. 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. http://api.tumblr.com).

func (*TumblrRestClient) Avatar Uses

func (trc *TumblrRestClient) Avatar(blogname string, size int) AvatarResponse

Retrieves the url of the blog's avatar. size can be: 16, 24, 30, 40, 48, 64, 96, 128 or 512.

func (*TumblrRestClient) BlogInfo Uses

func (trc *TumblrRestClient) BlogInfo(blogname string) BlogInfoResponse

Gets general information about the blog. blogname: name of the blog you want to get information about(e.g. mgterzieva.tumblr.com).

func (*TumblrRestClient) BlogLikes Uses

func (trc *TumblrRestClient) BlogLikes(blogname string, options map[string]string) LikesResponse

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 (*TumblrRestClient) CreateAudio Uses

func (trc *TumblrRestClient) CreateAudio(blogname string, options map[string]string) error

Create 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; *external_url: the url of the site that hosts the audio file.

func (*TumblrRestClient) CreateChatPost Uses

func (trc *TumblrRestClient) CreateChatPost(blogname string, options map[string]string) error

Create 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 (trc *TumblrRestClient) CreateLink(blogname string, options map[string]string) error

Create 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 (*TumblrRestClient) CreatePhoto Uses

func (trc *TumblrRestClient) CreatePhoto(blogname string, options map[string]string) error

Create 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 (*TumblrRestClient) CreateQuote Uses

func (trc *TumblrRestClient) CreateQuote(blogname string, options map[string]string) error

Create 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 (*TumblrRestClient) CreateText Uses

func (trc *TumblrRestClient) CreateText(blogname string, options map[string]string) error

Create 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 (*TumblrRestClient) CreateVideo Uses

func (trc *TumblrRestClient) CreateVideo(blogname string, options map[string]string) error

Create 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 (*TumblrRestClient) Dashboard Uses

func (trc *TumblrRestClient) Dashboard(options map[string]string) DraftsResponse

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); since_id: 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 (*TumblrRestClient) DeletePost Uses

func (trc *TumblrRestClient) DeletePost(blogname, id string) error

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 (*TumblrRestClient) Drafts Uses

func (trc *TumblrRestClient) Drafts(blogname string, options map[string]string) DraftsResponse

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 (*TumblrRestClient) EditPost Uses

func (trc *TumblrRestClient) EditPost(blogname string, options map[string]string) error

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 (*TumblrRestClient) Follow Uses

func (trc *TumblrRestClient) Follow(blogname string) error

Follow the url of a given blog. blogname: the url of the blog to follow.

func (*TumblrRestClient) Followers Uses

func (trc *TumblrRestClient) Followers(blogname string, options map[string]string) FollowersResponse

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 (*TumblrRestClient) Following Uses

func (trc *TumblrRestClient) Following(options map[string]string) FollowingResponse

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 (*TumblrRestClient) Info Uses

func (trc *TumblrRestClient) Info() UserInfoResponse

Gets the user information.

func (*TumblrRestClient) Like Uses

func (trc *TumblrRestClient) Like(id, reblogKey string) error

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 (*TumblrRestClient) Likes Uses

func (trc *TumblrRestClient) Likes(options map[string]string) LikesResponse

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 (*TumblrRestClient) Posts Uses

func (trc *TumblrRestClient) Posts(blogname, postsType string, options map[string]string) PostsResponse

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 (*TumblrRestClient) Queue Uses

func (trc *TumblrRestClient) Queue(blogname string, options map[string]string) DraftsResponse

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 (*TumblrRestClient) Reblog Uses

func (trc *TumblrRestClient) Reblog(blogname string, options map[string]string) error

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 (*TumblrRestClient) Submission Uses

func (trc *TumblrRestClient) Submission(blogname string, options map[string]string) DraftsResponse

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 (*TumblrRestClient) Tagged Uses

func (trc *TumblrRestClient) Tagged(tag string, options map[string]string) []json.RawMessage

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).

func (*TumblrRestClient) Unfollow Uses

func (trc *TumblrRestClient) Unfollow(blogname string) error

Unfollow the url of a given blog. blogname: the url of the blog to unfollow.

func (*TumblrRestClient) Unlike Uses

func (trc *TumblrRestClient) Unlike(id, reblogKey string) error

Unlike a post of a given blog. id: the id of the post you want to unlike. reblog_key: the reblog key for the post id.

type User Uses

type User struct {
    Name      string
    Following bool
    Url       string
    Updated   int64
}

type UserInfo Uses

type UserInfo struct {
    Following           int64
    Default_post_format string
    Name                string
    Likes               int64
    Blogs               []OwnedBlog
}

type UserInfoResponse Uses

type UserInfoResponse struct {
    User UserInfo
}

type VideoPost Uses

type VideoPost struct {
    BasePost
    Caption string
    Player  []PlayerInfo
}

Package gotumblr imports 8 packages (graph) and is imported by 15 packages. Updated 2017-05-08. Refresh now. Tools for package owners.