An open API service indexing awesome lists of open source software.

https://github.com/favstats/untruthr

The goal of untruthr is to provide a scraper for the social networking app Truth Social
https://github.com/favstats/untruthr

Last synced: about 1 year ago
JSON representation

The goal of untruthr is to provide a scraper for the social networking app Truth Social

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# untruthr

[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![CRAN status](https://www.r-pkg.org/badges/version/untruthr)](https://CRAN.R-project.org/package=untruthr)

The goal of `untruthr` is to provide access to the social networking website [Truth Social](https://truthsocial.com/)

## Installation

You can install the development version of `untruthr` like so:

``` r
remotes::install_github("favstats/untruthr")
```

## Example

First load in R package

```{r example}
library(untruthr)
## basic example code
```

## Authentication

Authenticate yourself with `untruth_auth`. Note: you require a Truth Social account for this.

Set the following environment variables (note it's best to type this into your console so you don't create a script with your valuable login details):

```{r, eval = F}
## NOTE: Client ID and Client Secret seem to be the same for every single user
set_renv(truth_social_client_id="9X1Fdd-pxNsAgEDNi_SfhJWi8T-vLuV2WVzKIbkTCw4")
set_renv(truth_social_client_secret="ozF8jzI4968oTKFkEnsBC-UbLPCdrSv0MkXGQu2o_-M")
## is that safe? I don't know but I also don't have a social media platform sooo..
```

```{r, eval = F}
## set your user handle and pw here:
set_renv(truth_social_user="YOUR_USER_HANDLE")
set_renv(truth_social_pw="YOUR_PW")

```

Once you are done, run `untruth_auth`.

```{r, eval = F}
untruth_auth()
```

Now you can use `untruthr`. Note: you only need to authenticate once. You only have to redo this once your token becomes stale, which does not seem to happen very often. It seems like the token is active for a few days at least. Will update once I know more.

## Get trending hashtags

```{r}
untruth_trends()
```

## Get trending statuses

```{r}
untruth_trends(type = "truths")
```

## Get statuses from account

In this case we are getting the 40 last "truths" from Donald Trump

```{r}
# debugonce(untruth_user_statuses)
untruth_user_statuses("realdonaldtrump", size = 40)

```

## Search for statuses containing keywords

```{r}
untruth_search("qanon", search_type = "statuses", size = 40)
```

## Search for accounts containing keywords

```{r}
# debugonce(untruth_search)
untruth_search("qanon", search_type = "accounts", size = 40)
```

## Lookup user ids (and other info) about users

```{r}
untruth_lookup_users("realdonaldtrump")
```