Learn R Programming

rtweet (version 1.2.1)

post_favorite: Favorites target status id.

Description

Favorites target status id.

Usage

post_favorite(
  status_id,
  destroy = FALSE,
  include_entities = FALSE,
  token = NULL
)

Arguments

status_id

Status id of target tweet.

destroy

Logical indicating whether to post (add) or remove (delete) target tweet as favorite.

include_entities

Logical indicating whether to include entities object in return.

token

Use this to override authentication for a single API call. In many cases you are better off changing the default for all calls. See auth_as() for details.

References

Create: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-create Destroy: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-destroy

See Also

Other post: post_follow(), post_friendship(), post_tweet()

Examples

Run this code
if (auth_has_default()) {
   rt <- search_tweets("#rstats", n = 1)
   post_favorite(rt$id_str)
}

Run the code above in your browser using DataLab