knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

TwitterAnalyticsDownloader

Twitter Analytics provides detailed data of a twitter account's tweets: number of impressions, engagement rate, number of retweets, link clicks, etc. However, the website restricts the maximum possible date range to a 91-day window.

This R script downloads the tweet activity data from Twitter Analytics for any given period. If the selected date range is longer than 91 days, the download is split into several downloads.

Prerequisites

The only requirement is having the RSelenium package installed. You can install it by running:

install.packages("RSelenium")

Installing

To install the script you will need the devtoolspackage:

install.packages("devtools")
library(devtools)

Then you can install the script directly from GitHub by running:

install_github("pferrando/TwitterAnalyticsDownloader")

Example

The main function is twitter_analytics_downloader, which will download one or more csv files containing tweets activity.

You will have to provide:

You can download the Twitter Analytics report/s using the following code:

library(TwitterAnalyticsDownloader)

twitter_analytics_downloader("your-user-name", "your-password", "2018-01-01", "2018-04-01")


pferrando/TwitterAnalyticsDownloader documentation built on May 24, 2019, 9:52 a.m.