Learn R Programming

saotd (version 0.3.1)

tweet_acquire: Acquire Twitter Tweets

Description

Function will enable a user to access the Twitter API through the [Twitter Developers Account](https://dev.twitter.com/) site. Once a user has a Twitter developers account and has received their individual consumer key, consumer secret key, access token, and access secret they can acquire Tweets based on a list of hashtags and a requested number of entries per query.

Usage

tweet_acquire(
  twitter_app,
  consumer_api_key,
  consumer_api_secret_key,
  access_token,
  access_token_secret,
  query,
  num_tweets,
  reduced_tweets = TRUE,
  distinct = TRUE
)

Value

A Data Frame with tweets and meta data.

Arguments

twitter_app

The name of user created Twitter Application.

consumer_api_key

Twitter Application management consumer API key.

consumer_api_secret_key

Twitter Application management consumer API secret key. Application must have Read and write access level and Callback URL of http://127.0.0.1:1410.

access_token

Twitter Application management access token (apps.twitter.com).

access_token_secret

Twitter Application management access secret token (apps.twitter.com).

query

A single query or a list of queries the user has specified. Character string, not to exceed 500 characters. To search for tweets containing at least one of multiple possible terms, separate each search term with spaces and "OR" (in caps). For example, the search q = "data science" looks for tweets containing both "data" and "science" located anywhere in the tweets and in any order. When "OR" is entered between search terms, query = "data OR science", Twitter's REST API should return any tweet that contains either "data" or "science."

num_tweets

Number of Tweets to be acquired per each hashtag.

reduced_tweets

Logical. If reduced_tweets = TRUE, the data frame returned to the user will be significantly reduced specifically for use in the `saotd` package. If reduced_tweets = FALSE, the full results from the Twitter API will be returned.

distinct

Logical. If distinct = TRUE, the function removes multiple Tweets that originate from the same Twitter id at the exact same time.