retrieve_tweets: Import tweets

View source: R/tweets-retrieve.R

retrieve_tweetsR Documentation

Import tweets

Description

Import tweets from xGPhilosophy

Screenshot xGPhilosophy's latest tweet

Usage

retrieve_tweets(
  method = .get_valid_tweet_methods(),
  user = .get_user(),
  ...,
  tweets = NULL,
  n = 3200,
  dir = .get_dir_data(),
  file = sprintf("%s_timeline", user),
  ext = "rds",
  path = NULL,
  f_import = readr::read_rds,
  f_export = readr::write_rds,
  export = TRUE
)

screenshot_latest_tweet(
  tweets = NULL,
  status_id = NULL,
  user = .get_user(),
  dir = .get_dir_data(),
  file = sprintf("%s_latest_tweet", user),
  ext = "png",
  path = NULL,
  ...
)

Arguments

method

How to retrieve tweets.

user

User for whom to retrieve tweets for. (xGPhilophy by default.)

...

Extra parameters passed to tweetrmd::tweet_screenshot()

tweets

This can be tweets retrieved from something like retrieve_tweets() or just a data frame with at least created_at and status_id.

n

Number of tweets to retrieve. (3200 by default.)

dir

Directory to use to generate path if path is not explicitly provided.

file

File name (without extension) to generate path if path is not explicitly provided.

ext

File extension to use to generate path if path is not explicitly provided.

path

Path to export to.

f_import

Function to import with if file exists and overwrite = TRUE.

f_export

Function to export with if export = TRUE .

export

Whether to export. Supersedes 'overwrite.

Valid methods

  • "none" return existing tweets at path

  • "all" re-trieve and return entire timeline

  • "since" retrieve timeline since last tweet saved at path and return it along with existing tweets (functionally this will return the same results as "all" , unless a tweet has since been deleted)

  • "new" only retrieve and return timeline since last tweet saved at path


tonyelhabr/xengagement documentation built on June 22, 2022, 5 a.m.