File: rtweet.Rmd

package info (click to toggle)
r-cran-rtweet 2.0.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,068 kB
  • sloc: sh: 13; makefile: 2
file content (124 lines) | stat: -rw-r--r-- 1,810 bytes parent folder | download | duplicates (2)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
title: "Intro to rtweet"
output:
  rmarkdown::html_vignette:
    fig_caption: true
    code_folding: show
    toc_float:
      collapsed: true
      toc_depth: 3
vignette: >
  %\VignetteIndexEntry{Intro to rtweet}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---



This vignette provides a quick tour of the R package, describing what could be possible to do.


```r
library("rtweet")
```

## Authenticate

First you should set up your own credentials, lease read the `vignette("auth", "rtweet")`.

## Free

### Posting statuses

You can post tweets with:

```r
tweet_post(paste0("My first tweet with #rtweet #rstats at ", Sys.time()))
```

###  Your own data

```r
user_self()
```


## Paid

### Search tweets

You can search tweets:


```r
rstats <- tweet_search_recent("#rstats", n = 100)
```


```r
tweets_peace <- tweet_search_all("peace", n = 250000, retryonratelimit = TRUE)
```

### Get friends

Retrieve a list of all the accounts a **user follows**.

```r
user_following("1234565")
```

### Get followers

If you really want all the users that follow the account we can use `user_follower()`:

```r
R_foundation_flw <- user_follower("1599030512919650304")
```

### Search users

We can use `user_search()`:


```r
users <- user_search(c("1599030512919650304", "2244994945"))
```


### Get timelines

Get the most recent tweets from R Foundation.

```r
R_foundation_tline <- user_timeline("1599030512919650304")
```

### Get favorites

Get the 10 recently favorited statuses by R Foundation.


```r
R_foundation_favs <- user_liked_tweets("1599030512919650304")
```


### Muting users

You can list those users muted:


```r
um <- user_muted(user_self()$id)
```


### Blocking users

You can block users and unblock them:


```r
user_block("rtweet")
user_unblock("rtweet")
```