Skip to content

Instantly share code, notes, and snippets.

View AdamSpannbauer's full-sized avatar
👀
¯\_(ツ)_/¯

Adam Spannbauer AdamSpannbauer

👀
¯\_(ツ)_/¯
View GitHub Profile
##################################################################
# ADDRESSING https://github.com/AdamSpannbauer/lexRankr/issues/8
##################################################################
# GET EXAMPLE DATA
#----------------------------------------------------------
library(xml2)
library(rvest)
options(stringsAsFactors = FALSE)
@AdamSpannbauer
AdamSpannbauer / get_twitter_time_dataframe.R
Created March 10, 2017 02:58
Get tweets from a user's timeline
get_timeline_df <- function(user, n_tweets=200, oauth_sig) {
i <- 0
n_left <- n_tweets
timeline_df <- NULL
#loop until n_tweets are all got
while (n_left > 0) {
n_to_get <- min(200, n_left)
i <- i+1
#incorporae max id in get_url (so as not to download same 200 tweets repeatedly)
if (i==1) {