posts: Retrieve Published Posts.

Description Usage Arguments Details Value Author(s) References Examples

View source: R/posts.R

Description

This function retrieves published posts.

Usage

1
2
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")

Arguments

base_hostname

The standard or custom blog hostname. See Details.

limit

The number of results to return: 1-20, inclusive.

offset

Result to start at. 0 is the first follower.

api_key

The consumer secret provided by your application. See Details.

type

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.

id

A specific post ID. Returns the single post specified or (if not found) a 404 error.

tag

Limits the response to posts with the specified tag.

reblog_info

Indicates whether to return reblog information (specify TRUE or FALSE). Returns the various reblogged_fields. See Details.

notes_info

Indicates whether to return notes information (specify TRUE or FALSE). Returns note count and note metadata. See Details.

filter

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.

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.

Value

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.

blog_name

A string. The short name used to uniquely identify a blog.

id

A number. The post's unique ID.

post_url

A string. The location of the post.

type

A string. The type of post.

timestamp

A number. The time of the post, in seconds since the epoch.

date

A string. The GMT date and time of the post, as a string.

format

A string. The post format: html or markdown.

reblog_key

A string. The key used to reblog this post.

tags

An array (string). Tags applied to the post.

bookmarklet

A boolean. Indicates whether the post was created via the Tumblr bookmarklet. Exists only if true.

mobile

A boolean. Indicates whether the post was created via mobile/email publishing. Exists only if true.

source_url

A string. The URL for the source of the content for quotes, reblogs, etc.. Exists only if there is a content source.

source_title

A string. The title of the source site. Exists only if there is a content source.

liked

A boolean. Indicates if a user has already liked a post or not.Exists only if the request is fully authenticated with OAuth.

state

A string. Indicates the current state of the post. States are: published, queued, draft and private.

total_posts

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.

Author(s)

Andrea Capozio

References

https://www.tumblr.com/docs/en/api/v2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

## End(Not run)

tumblR documentation built on March 18, 2020, 5:09 p.m.

Related to posts in tumblR...