-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
77 lines (51 loc) · 1.4 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# tweetsel
<!-- badges: start -->
<!-- badges: end -->
This package provides a way to get tweets of a user from a certain timerange using `Rselenium`.
Make sure that you are running a Twitter version that looks like this or else it won't work:
![](inst/logos/twitter.png)
## Installation
The development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("favstats/tweetsel")
```
## Example
Load in Package
```{r example}
library(tweetsel)
```
```{r, eval = F, include=F}
rD <- RSelenium::rsDriver(browser=c("chrome"), chromever="78.0.3904.105", port = port)
binman::list_versions("chromedriver")
```
Create a WebDriver with `RSelenium`
```{r, eval = F}
port <- sample(4000L:5000L, 1)
rD <- RSelenium::rsDriver(port = port)
driver <- rD$client
```
Get desired data in time range:
```{r, eval = F}
driver %>%
get_spec_timeline(screen_name = "realdonaldtrump",
from = "2018-05-20", #earliest date
until = "2018-05-01", #latest date
path = "data/tweets.csv") #specify how csv is named & saved
```
Output:
```{r}
read.csv("data/tweets.csv")
```