-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
69 lines (48 loc) · 1.25 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
library(blueRsky)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
bsky_login(user = "colin-fraser.net", pwd = Sys.getenv("BLUESKY_PWD"))
```
# blueRsky
<!-- badges: start -->
<!-- badges: end -->
Talking to bluesky from R.
## Installation
You can install the development version of blueRsky like so:
``` r
devtools::install_github("colin-fraser/blueRsky")
```
You'll also need my other package, `{wrapify}`, which you can install with
``` r
devtools::install_github("colin-fraser/wrapify")
```
## Getting Started
It's easy to start. Run `bsky_login()` with your username and an app password.
``` r
library(blueRsky)
bsky_login(username, app_password)
```
Functions that start with `bsky_` talk to bluesky.
## Sending a post
Here's how you can send a post.
```{r}
post <- bsky_create_post("This post was created in R using the blueRsky package at github.com/colin-fraser/blueRsky")
post
```
## Fetch a timeline
```{r}
tl <- bsky_get_timeline(limit = 10)
tl$feed |>
purrr::map(\(x) {
paste(x$post$author$handle, x$post$record$text, sep = ': ')
})
```