# Intro to rtweet

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

Code

    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:

Code

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

### Your own data

Code

    user_self()

## Paid

### Search tweets

You can search tweets:

Code

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

Code

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

### Get friends

Retrieve a list of all the accounts a user follows.

Code

    user_following("1234565")

### Get followers

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

Code

    R_foundation_flw <- user_follower("1599030512919650304")

### Search users

We can use `user_search()`:

Code

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

### Get timelines

Get the most recent tweets from R Foundation.

Code

    R_foundation_tline <- user_timeline("1599030512919650304")

### Get favorites

Get the 10 recently favorited statuses by R Foundation.

Code

    R_foundation_favs <- user_liked_tweets("1599030512919650304")

### Muting users

You can list those users muted:

Code

    um <- user_muted(user_self()$id)

### Blocking users

You can block users and unblock them:

Code

    user_block("rtweet")
    user_unblock("rtweet")