Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/yonicd/slackthreads

Wrangle slack conversations, replies and threads in R
https://github.com/yonicd/slackthreads

Last synced: about 1 month ago
JSON representation

Wrangle slack conversations, replies and threads in R

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%",
eval = FALSE
)
```

# slackthreads

[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2023_03_11-brightgreen.svg)](https://tinyurl.com/2mtuu5gu)
[![R-CMD-check](https://github.com/yonicd/slackthreads/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/yonicd/slackthreads/actions/workflows/r-cmd-check.yml)
[![Codecov test coverage](https://codecov.io/gh/yonicd/slackthreads/branch/master/graph/badge.svg)](https://codecov.io/gh/yonicd/slackthreads?branch=master)

`slackthreads` is a part of `slackverse`

```{r,echo = FALSE, eval = TRUE}
pkgs <- sprintf('slack%s',c('calls','teams','posts','blocks','threads','reprex'))

badges <- sprintf('%s
[![](https://github.com/yonicd/%s/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/yonicd/%s)',pkgs,pkgs,pkgs)

names(badges) <- pkgs

```

||||
|:-:|:-:|:-:|
||`r badges[pkgs[1]]`||
|`r badges[pkgs[5]]`|`r badges[pkgs[2]]`|`r badges[pkgs[3]]`|
|||`r badges[pkgs[4]]`|
|||`r badges[pkgs[6]]`|

The goal of `slackthreads` is to interact with the Slack API to retrieve and interrogate team conversations.

## Installation

``` r
remotes::install_github("yonicd/slackthreads")
```

## In the Tin

- Fetch messages from conversations
- Fetch replies in slackthreads to the messages in the conversations

## Example Using [R4DS Slack](https://www.rfordatasci.com/)

```{r}
library(slackteams)
library(slackthreads)

```

### Load the Team
```{r}
slackteams::load_teams()
slackteams::activate_team('R4ds')
```

### Retrieve Team Channels

```{r}
chnls <- slackteams::get_team_channels()

# r4ds has channels to ask questions in
question_channels <- grep('^help-',chnls$name,value = TRUE)

question_channels
```

### Retrieve Conversations

This will retrieve the last 20 messages from the "help-1-explore_wrangle" channel.

```{r}

convos <- conversations(
channel = 'help-1-explore_wrangle',
limit = 20,
max_results = 20
)

```

Check that request was returned ok and that up to 20 were returned.

```{r}
length(convos)
```

There are the following replies to the first message

```{r}
convos[[1]]$reply_count
```