| Title: | Collecting and Analyzing 'Tumblr' Data |
|---|---|
| Description: | An implementation of calls designed to collect 'Tumblr' data via its Application Program Interfaces (API), which can be found at the following URL: <https://www.tumblr.com/docs/en/api/v2>. |
| Authors: | David Schoch [aut, cre] (ORCID: <https://orcid.org/0000-0003-2952-4812>) |
| Maintainer: | David Schoch <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-06-10 20:38:50 UTC |
| Source: | https://github.com/schochastics/Rtumblr |
Retrieve a Blog Avatar You can get a blog's avatar in 9 different sizes
get_blog_avatar(blog, size = 64)get_blog_avatar(blog, size = 64)
blog |
name of the blog |
size |
Integer. The size of the avatar (square, one value for both length and width). Must be one of the values: 16, 24, 30, 40, 48, 64, 96, 128, 512 |
png of avatar
## Not run: avatar <- get_blog_avatar("schochastics") png::writePNG("avatar_schochastics.png") ## End(Not run)## Not run: avatar <- get_blog_avatar("schochastics") png::writePNG("avatar_schochastics.png") ## End(Not run)
Get the blogs that the requested blog is currently blocking. The requesting user must be an admin of the blog to retrieve this list. Note that this endpoint is rate limited to 60 requests per minute.
get_blog_blocks( blog, limit = 20, offset = 0, n = limit, app_credentials = NULL )get_blog_blocks( blog, limit = 20, offset = 0, n = limit, app_credentials = NULL )
blog |
name of the blog |
limit |
number of blocks to retrieve per request (1-20) |
offset |
block number to start at (default 0) |
n |
maximum number of blocks to retrieve across pages (default |
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
tibble of blocked blogs
## Not run: # replace "your-blog-name" with your Tumblr username get_blog_blocks(blog = "your-blog-name") ## End(Not run)## Not run: # replace "your-blog-name" with your Tumblr username get_blog_blocks(blog = "your-blog-name") ## End(Not run)
Check If Followed By Blog This method can be used to check if one of your blogs is followed by another blog.
get_blog_followed_by(blog, query, app_credentials = NULL)get_blog_followed_by(blog, query, app_credentials = NULL)
blog |
name of the blog |
query |
string. The name of the blog that may be following your blog |
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
logical
## Not run: # replace "your-blog-name" with your Tumblr username get_blog_followed_by(blog = "your-blog-name", query = "blog-to-check") ## End(Not run)## Not run: # replace "your-blog-name" with your Tumblr username get_blog_followed_by(blog = "your-blog-name", query = "blog-to-check") ## End(Not run)
This method can be used to retrieve the publicly exposed list of blogs that follow a blog, in order from most recently-followed to first. Only works with your own blog
get_blog_followers( blog, limit = 20, offset = 0, n = limit, app_credentials = NULL, ... )get_blog_followers( blog, limit = 20, offset = 0, n = limit, app_credentials = NULL, ... )
blog |
name of the blog |
limit |
The number of results to return per request: 1-20 |
offset |
post index to start at |
n |
maximum number of posts to retrieve across pages (default |
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
a tibble of blogs
## Not run: # replace "your-blog-name" with your Tumblr username get_blog_followers(blog = "your-blog-name") ## End(Not run)## Not run: # replace "your-blog-name" with your Tumblr username get_blog_followers(blog = "your-blog-name") ## End(Not run)
This method can be used to retrieve the publicly exposed list of blogs that a blog follows, in order from most recently-followed to first. Only works with your own account
get_blog_following( blog, limit = 20, offset = 0, n = limit, app_credentials = NULL, ... )get_blog_following( blog, limit = 20, offset = 0, n = limit, app_credentials = NULL, ... )
blog |
name of the blog |
limit |
The number of results to return per request: 1-20 |
offset |
post index to start at |
n |
maximum number of posts to retrieve across pages (default |
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
a tibble of blogs
## Not run: # replace "your-blog-name" with your Tumblr username get_blog_following(blog = "your-blog-name") ## End(Not run)## Not run: # replace "your-blog-name" with your Tumblr username get_blog_following(blog = "your-blog-name") ## End(Not run)
This method returns general information about the blog, such as the title, number of posts, and other high-level data.
get_blog_info(blog, api_key = NULL)get_blog_info(blog, api_key = NULL)
blog |
name of the blog |
api_key |
app consumer key. If NULL, attempts to load from the environment variable RTUMBLR_TOKEN |
tibble of information about blog
## Not run: get_blog_info("schochastics") ## End(Not run)## Not run: get_blog_info("schochastics") ## End(Not run)
This method can be used to retrieve the publicly exposed likes from a blog. Seems to work only for your own blog
get_blog_likes( blog, limit = 20, offset = 0, n = limit, after, before, api_key = NULL, ... )get_blog_likes( blog, limit = 20, offset = 0, n = limit, after, before, api_key = NULL, ... )
blog |
name of the blog |
limit |
The number of results to return per request: 1-20 |
offset |
post index to start at |
n |
maximum number of posts to retrieve across pages (default |
after |
integer. Retrieve posts liked after the specified timestamp |
before |
integer. Retrieve posts liked before the specified timestamp |
api_key |
app consumer key. If NULL, attempts to load from the environment variable RTUMBLR_TOKEN |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
You can only provide either before, after, or offset. If you provide more than one of these options together you will get an error. You can still use limit with any of those three options to limit your result set. When using the offset parameter the maximum limit on the offset is 1000. If you would like to get more results than that use either before or after.
tibble of liked posts
## Not run: # replace "your-blog-name" with your Tumblr username get_blog_likes(blog = "your-blog-name") ## End(Not run)## Not run: # replace "your-blog-name" with your Tumblr username get_blog_likes(blog = "your-blog-name") ## End(Not run)
Retrieve Published Posts
get_blog_posts(blog, limit = 20, offset = 0, n = limit, api_key = NULL, ...)get_blog_posts(blog, limit = 20, offset = 0, n = limit, api_key = NULL, ...)
blog |
name of the blog |
limit |
The number of results to return per request: 1-20 |
offset |
post index to start at |
n |
maximum number of posts to retrieve across pages (default |
api_key |
app consumer key. If NULL, attempts to load from the environment variable RTUMBLR_TOKEN |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
this function uses the new post format (npf: https://www.tumblr.com/docs/npf).
Pagination is handled automatically: it pages through offset up to the API cap of 1000,
then continues via the before timestamp, until n posts are collected or the blog is exhausted.
a tibble of blog posts
## Not run: # replace "blog-name" with a Tumblr username get_blog_posts(blog = "blog-name") # retrieve all posts of a blog get_blog_posts(blog = "blog-name", n = Inf) ## End(Not run)## Not run: # replace "blog-name" with a Tumblr username get_blog_posts(blog = "blog-name") # retrieve all posts of a blog get_blog_posts(blog = "blog-name", n = Inf) ## End(Not run)
Returns the posts in the authenticating user's dashboard.
Requires OAuth authentication (see rtumblr_auth()).
get_dashboard(limit = 20, offset = 0, n = limit, app_credentials = NULL, ...)get_dashboard(limit = 20, offset = 0, n = limit, app_credentials = NULL, ...)
limit |
The number of results to return per request: 1-20 |
offset |
post index to start at |
n |
maximum number of posts to retrieve across pages (default |
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
a tibble of posts
## Not run: get_dashboard() ## End(Not run)## Not run: get_dashboard() ## End(Not run)
Fetch a specific post by its id (new post format).
get_post(blog, post_id, api_key = NULL)get_post(blog, post_id, api_key = NULL)
blog |
name of the blog |
post_id |
the id of the post to retrieve |
api_key |
app consumer key. If NULL, attempts to load from the environment variable RTUMBLR_TOKEN |
a tibble with the post
## Not run: get_post("blog-name", post_id = "1234567890") ## End(Not run)## Not run: get_post("blog-name", post_id = "1234567890") ## End(Not run)
Get the notes (likes, reblogs, replies) for a specific post.
get_post_notes( blog, post_id, mode = "all", before_timestamp = NULL, api_key = NULL )get_post_notes( blog, post_id, mode = "all", before_timestamp = NULL, api_key = NULL )
blog |
name of the blog |
post_id |
the id of the post |
mode |
one of "all", "likes", "conversation", "rollup", or "reblogs_with_tags" |
before_timestamp |
fetch notes created before this timestamp (for pagination) |
api_key |
app consumer key. If NULL, attempts to load from the environment variable RTUMBLR_TOKEN |
a tibble of notes
## Not run: get_post_notes("blog-name", post_id = "1234567890") ## End(Not run)## Not run: get_post_notes("blog-name", post_id = "1234567890") ## End(Not run)
Get Posts with Tag
get_posts_tag(tag, before, limit = 20, n = limit, api_key = NULL, ...)get_posts_tag(tag, before, limit = 20, n = limit, api_key = NULL, ...)
tag |
tag to search for |
before |
the timestamp of when you'd like to see posts before |
limit |
number of results to return per request: 1-20 |
n |
maximum number of posts to retrieve across pages (default |
api_key |
app consumer key. If NULL, attempts to load from the environment variable RTUMBLR_TOKEN |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
This function uses the legacy post format since it appears to not support the new post format.
The /tagged endpoint does not support offset; pagination is done with the before
timestamp, which is handled automatically when n is larger than limit.
a list of tibbles of blog posts by format of posts
## Not run: get_posts_tag(tag="meme") # retrieve up to 100 posts across pages get_posts_tag(tag="meme", n = 100) ## End(Not run)## Not run: get_posts_tag(tag="meme") # retrieve up to 100 posts across pages get_posts_tag(tag="meme", n = 100) ## End(Not run)
Returns the blogs followed by the authenticating user.
Requires OAuth authentication (see rtumblr_auth()).
get_user_following( limit = 20, offset = 0, n = limit, app_credentials = NULL, ... )get_user_following( limit = 20, offset = 0, n = limit, app_credentials = NULL, ... )
limit |
The number of results to return per request: 1-20 |
offset |
post index to start at |
n |
maximum number of posts to retrieve across pages (default |
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
a tibble of blogs
## Not run: get_user_following() ## End(Not run)## Not run: get_user_following() ## End(Not run)
Returns information about the authenticating user, including which blogs they own.
Requires OAuth authentication (see rtumblr_auth()).
get_user_info(app_credentials = NULL)get_user_info(app_credentials = NULL)
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
a tibble with the user's information; the user's blogs are stored in the blogs list column
## Not run: get_user_info() ## End(Not run)## Not run: get_user_info() ## End(Not run)
Returns the posts liked by the authenticating user.
Requires OAuth authentication (see rtumblr_auth()).
get_user_likes( limit = 20, offset = 0, n = limit, after, before, app_credentials = NULL, ... )get_user_likes( limit = 20, offset = 0, n = limit, after, before, app_credentials = NULL, ... )
limit |
The number of results to return per request: 1-20 |
offset |
post index to start at |
n |
maximum number of posts to retrieve across pages (default |
after |
integer. Retrieve posts liked after the specified timestamp |
before |
integer. Retrieve posts liked before the specified timestamp |
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
... |
further parameters as described here: https://www.tumblr.com/docs/en/api/v2 |
a tibble of liked posts
## Not run: get_user_likes() ## End(Not run)## Not run: get_user_likes() ## End(Not run)
Returns the authenticating user's rate/usage limits.
Requires OAuth authentication (see rtumblr_auth()).
get_user_limits(app_credentials = NULL)get_user_limits(app_credentials = NULL)
app_credentials |
a named list containing the consumer key and consumer secret. If NULL, attempts to load from an env variable |
a list with the user's limits as returned by the API
## Not run: get_user_limits() ## End(Not run)## Not run: get_user_limits() ## End(Not run)
Performs the interactive three-legged OAuth 1.0a flow: it opens a browser so you
can authorize the app, then exchanges the verifier for a durable access token. The
access token is cached on disk (under tools::R_user_dir()) so the browser only
opens once; subsequent sessions reuse the cached token.
rtumblr_auth(app_credentials = NULL, cache = TRUE, force = FALSE)rtumblr_auth(app_credentials = NULL, cache = TRUE, force = FALSE)
app_credentials |
a named list with |
cache |
logical, whether to read/write the access token from the on-disk cache. |
force |
logical, if |
You normally do not need to call this directly: any function that hits an
OAuth-protected endpoint will trigger it automatically when no cached token is found.
As before, you only need to provide your app's consumer key and secret via the
RTUMBLR_TOKEN environment variable ("consumer_key;consumer_secret").
invisibly, a list with oauth_token and oauth_token_secret.
## Not run: rtumblr_auth() ## End(Not run)## Not run: rtumblr_auth() ## End(Not run)