MyNixOS website logo
Description

Interact with 'Bluesky' Social.

Collect data from and make posts on 'Bluesky' Social via the Hypertext Transfer Protocol (HTTP) Application Programming Interface (API), as documented at <https://atproto.com/specs/xrpc>. This further supports broader queries to the Authenticated Transfer (AT) Protocol <https://atproto.com/> which 'Bluesky' Social relies on. Data is returned in a tidy format and posts can be made using a simple interface.

bskyr

Lifecycle:stable Codecov testcoverage R-CMD-check

bskyr provides an interface to the Bluesky API, allowing you to interact with Bluesky Social from R. To do this, we provide functions which match with the AT Protocol’s Lexicon, which is like using regular HTTP requests. Outputs from bskyr’s functions are primarily tibbles, allowing for easy analysis of the outputs from the API calls.

Installation

You can install the development version of bskyr from GitHub with:

# install.packages('devtools')
remotes::install_github('christopherkenny/bskyr')

Posting with bskyr

Posting capabilities are still under development.

library(bskyr)

Text posts can be made as follows:

bs_post('text = Your text goes here.')

If you have images to include, up to four can be included with the images argument:

bs_post(
  text = 'Your text goes here.', 
  images = c('path/to/image1.jpg', 'path/to/image2.png')
)

Alt text can be added to images with the images_alt argument:

bs_post(
  text = 'Your text goes here.', 
  images = c('path/to/image1.jpg', 'path/to/image2.png'), 
  images_alt = c('Alt text for image 1', 'Alt text for image 2')
)

To quote or reply to a post, use the quote and/or reply argument, respectively. These can take the link of an existing post. You can quote and reply to the same post, if you want.

bs_post(
  text = 'Your text goes here.', 
  quote = 'https://bsky.app/profile/chriskenny.bsky.social/post/3kepscxiljc22',
  reply = 'https://bsky.app/profile/chriskenny.bsky.social/post/3kepscxiljc22'
)

See the reference for additional features, including likes with bs_like() and reposts with bs_repost().

Authentication

To authenticate, you first need to make an App Password. To do this, go to https://bsky.app/settings. Under “Advanced” click App passwords and then “Add App Password.”

Once you have a password, you need to run:

set_bluesky_user('YOUR-USERNAME.bsky.social')
set_bluesky_pass('your-apps-pass-word')

If you want this to persist across sessions, set install = TRUE and r_env = file.path(Sys.getenv('HOME'), '.Renviron'). This will save your credentials in your R environment file.

Alternatively, you can set them manually using usethis::edit_r_environ() and adding lines like so:

BLUESKY_APP_USER='YOUR-USERNAME.bsky.social'
BLUESKY_APP_PASS='your-apps-pass-word'
Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows