This function retrieves published posts.
posts(base_hostname = NA, limit = 20, offset = 0, api_key = NA, type = NA,
id = NA, tag = NA, reblog_info = FALSE, notes_info = FALSE, filter = "HTML")
The standard or custom blog hostname. See Details.
The number of results to return: 1-20, inclusive.
Result to start at. 0 is the first follower.
The consumer secret provided by your application. See Details.
The type of post to return. The available values are: text, photo, quote, link, chat, audio, video, answer. If no values are specified, all types are returned.
A specific post ID. Returns the single post specified or (if not found) a 404 error.
Limits the response to posts with the specified tag.
Indicates whether to return reblog information (specify TRUE or FALSE). Returns the various reblogged_fields. See Details.
Indicates whether to return notes information (specify TRUE or FALSE). Returns note count and note metadata. See Details.
Specifies the post format to return, other than HTML: text - Plain text, no HTML; raw - As entered by the user (no post-processing); if the user writes in Markdown, the Markdown will be returned rather than HTML.
Each response includes a blog object that is equivalent of an info.blog response. Posts are returned as an array attached to the posts field. All post types have the following common response.
A string. The short name used to uniquely identify a blog.
A number. The post's unique ID.
A string. The location of the post.
A string. The type of post.
A number. The time of the post, in seconds since the epoch.
A string. The GMT date and time of the post, as a string.
A string. The post format: html or markdown.
A string. The key used to reblog this post.
An array (string). Tags applied to the post.
A boolean. Indicates whether the post was created via the Tumblr bookmarklet. Exists only if true.
A boolean. Indicates whether the post was created via mobile/email publishing. Exists only if true.
A string. The URL for the source of the content for quotes, reblogs, etc.. Exists only if there is a content source.
A string. The title of the source site. Exists only if there is a content source.
A boolean. Indicates if a user has already liked a post or not.Exists only if the request is fully authenticated with OAuth.
A string. Indicates the current state of the post. States are: published, queued, draft and private.
A number. The total number of post available for this request, useful for paginating through results.
For a specified type, other response fields are returned. See References for more details.
Each blog has a unique hostname. The hostname can be standard or custom. Standard hostname: the blog short name + .tumblr.com. Custom hostname: Anything at all, as determined by a DNS CNAME entry.
The API uses three different levels of authentication, depending on the method. None: No authentication. Anybody can query the method. API key: Requires an API key. Use your OAuth Consumer Key as your api_key. OAuth: Requires a signed request that meets the OAuth 1.0a Protocol.
reblog_info and notes_info are false by default because of the server impact involved in retrieving the data.
https://www.tumblr.com/docs/en/api/v2
# NOT RUN {
## An example of an authenticated request,
## where api_key is fictitious.
## You can obtain your own at https://www.tumblr.com/oauth/apps
api_key <- "key"
## you must specify a real blog for base_hostname
base_hostname <- "blogname.tumblr.com"
posts(base_hostname = base_hostname, type = "text", api_key = api_key)
# }
Run the code above in your browser using DataLab