Learn R Programming

carbonate (version 0.1.4)

.rtweet: send tweets using carbonate outputs

Description

wrapper for post_tweet to send tweets with media created using carbonate.

Usage

.rtweet(self, private, media, status = self$tweet_status,
  media_format = c("png", "gif"), ...)

Value

outcome from rtweet

Arguments

self

carbon self object

private

carbon private object

media

magick-image object or path to image

status

character, status to attach to post, Default: self$tweet_status

media_format

character, type of media to tweet, Default: c('png','gif')

...

arguments to pass to post_tweet

Details

If multiple images are passed they can be either converted to a gif by setting media_format to 'gif' or attached each one to the post.

See Also

image_write post_tweet

Examples

Run this code
if (FALSE) {
x <- carbonate::carbon$new()
x$carbonate(code = readLines(system.file('DESCRIPTION',package='carbonate')))
x$carbonate(code = 'x+2')

# using default status value (x$tweet_status)
x$rtweet(system.file('figures/hex_black_small.png',package='carbonate'))

x$rtweet(status = 'these are two pngs',media = x$carbons,media_format='png')
x$rtweet(status = 'this is a gif', media = x$carbons,media_format='gif')

}

Run the code above in your browser using DataLab