Skip to content

Simple R package for quickly downloading Twitter data using multiple keys!

Notifications You must be signed in to change notification settings

MorShahrezaye/bigTwitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is a simple R package that is developed to enable researchers downloading data from Twitter API using multiple keys. This package is developed for research and teaching purposes.

The main advantages of this package over the other R packages are:

  • Capability of using multiple Twitter keys! If you have 10 keys then you can download the data 10 times faster (using one line of code)!
  • The functions return the complete output as a datatable object (other packages trim the data!)

There is no gurantee that the functions perform as intended and there might be bugs in the code!

This package is for Linux operating system optimized and might not work properly in other operating systems (specially in Windows!).

Sample use

Downloading the complete list of friends of a Twitter user
#install and load the package
devtools::install_github("MorShahrezaye/bigTwitter", force = TRUE)
library(bigTwitteR)

#read the keys from the csv file
auth_df <- read.keys("keys.csv")

#define the query user
queryUser <- "MorShahrezaye"

#download the friendsof the query user
friends <- getFriendIDs(screen_name_list = queryUser, auth_df = auth_df, sleepTime = 1, verbose = T)

#downliad the friends of each friend of the query user (max 50k friends per user)
friendsLevel2 <- getFriendIDs(user_id_list = friends[[1]], auth_df = auth_df, sleepTime = 1, verbose = F, max_per_user = 50000)

#form the friendship network
g <- userEdgeList2graph(friends, friendsLevel2, friendsLevel3, directed = F)

Recommended urls

1- Twitter API documentation: https://developer.twitter.com/en/docs
2- A tutorial to rtweet package: https://mkearney.github.io/nicar_tworkshop/#1
3- A tool to visualize huge networks efficiently: https://gephi.org/users/download/

About

Simple R package for quickly downloading Twitter data using multiple keys!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages