{"id":16999749,"url":"https://github.com/jbgruber/atrrr","last_synced_at":"2025-03-17T09:30:47.380Z","repository":{"id":198867588,"uuid":"697421208","full_name":"JBGruber/atrrr","owner":"JBGruber","description":"AT Protocol (Authenticated Transfer Protocol behind Bluesky) R package","archived":false,"fork":false,"pushed_at":"2025-03-10T10:13:12.000Z","size":38870,"stargazers_count":28,"open_issues_count":5,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-10T11:23:09.330Z","etag":null,"topics":["atproto","bluesky","r"],"latest_commit_sha":null,"homepage":"https://jbgruber.github.io/atrrr","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JBGruber.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-27T17:37:54.000Z","updated_at":"2025-03-10T10:05:56.000Z","dependencies_parsed_at":"2023-12-20T08:22:36.551Z","dependency_job_id":"be7e3d6a-1638-4327-b3e1-8a10e75e1349","html_url":"https://github.com/JBGruber/atrrr","commit_stats":null,"previous_names":["jbgruber/atr","jbgruber/atrrr"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBGruber%2Fatrrr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBGruber%2Fatrrr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBGruber%2Fatrrr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBGruber%2Fatrrr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JBGruber","download_url":"https://codeload.github.com/JBGruber/atrrr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858891,"owners_count":20359257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atproto","bluesky","r"],"created_at":"2024-10-14T04:10:02.540Z","updated_at":"2025-03-17T09:30:47.374Z","avatar_url":"https://github.com/JBGruber.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  message = FALSE,\n  warning = FALSE,\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\nknitr::knit_hooks$set(document = function(x, options) \n  gsub(\"(figures/\", \"(vignettes/figures/\", x, fixed = TRUE))\n\nlibrary(dplyr)\nlibrary(purrr)\n```\n\n# atrrr \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"120\"\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/atrrr)](https://CRAN.R-project.org/package=atrrr)\n[![R-CMD-check](https://github.com/JBGruber/atrrr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JBGruber/atrrr/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/JBGruber/atrrr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/JBGruber/atrrr?branch=main)\n\u003c!-- badges: end --\u003e\n\nThe goal of atrrr[^1] is to wrap the AT Protocol (Authenticated Transfer Protocol) behind Bluesky. [*And we have actually already fulfilled this goal!*](#want-to-help).\n\nThe entire protocol is open and documented in so-called [lexicons](https://atproto.com/guides/lexicon), from which we autogenerated `R` functions.\n\nThese are not exported, however, since dealing with them is a bit advanced.\nRather we have some nice human-generated functions with documentation and examples.\n\n## Installation\n\nYou can install atrrr from CRAN with:\n\n``` r\ninstall.packages(\"atrrr\")\n```\n\nYou can install the development version of `atrrr` like so (install the `remotes` package first, with `install.packages(\"remotes\")`, if you don't have that yet):\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"JBGruber/atrrr\")\n```\n\n## Load the package\n\n```{r setup}\nlibrary(atrrr)\n```\n\n\n## Authentication\n\nThe first time you make a request, you will be prompted automatically to enter your user handle and an app password to authenticate `atrrr` to communicate with BlueSky for you.\n\n![RStudio Popup](figures/password_popup.png)\n\nThe page to generate app passwords is also automatically opened for you.\n\n![page to create new app passwords](figures/app_password.png)\n\nHowever, you can also trigger this process manually:\n\n```{r eval=FALSE}\nauth(\"jbgruber.bsky.social\")\n```\n\nThis can be useful if you want to replace an old token as it is permanently stored encrypted on disk.\n\n\n\n## Retrieve Skeets (`get_skeets_authored_by`)\n\nTo fetch all the skeets by a specific user, use the `get_skeets_authored_by` function. *Note this also includes quote skeets and reskeets.* You can also opt not to parse the result by setting `parse = FALSE`, however it is recommended to use the default parse option which results in a (more) tidy tibble.\n\n```{r}\nget_skeets_authored_by(actor = \"benguinaudeau.bsky.social\", parse = TRUE) |\u003e\n  dplyr::glimpse()\n```\n\n\n\n\n## Analyzing Feeds on Blue Sky\n\nOn Blue Sky users have the ability to create custom feeds based on specific keywords. These feeds aggregate content, for instance, a user might curate a feed around the hashtag `#rstats` to gather all relevant content about. Let's delve into the dynamics of such feeds.\n\n\nOur starting point is to extract the posts from the `#rstats` feed created by \"andrew.heiss.phd\".\n\n\n```{r}\n# Fetching the feed posts\nfeeds \u003c- get_feeds_created_by(actor = \"andrew.heiss.phd\") \n\n# Filtering for a specific keyword, for example \"#rstats\"\nrstat_feed \u003c- feeds |\u003e\n  filter(displayName == \"#rstats\")\n\n# Extracting posts from this curated feed\nrstat_posts \u003c- get_feed(rstat_feed$uri, limit = 200) |\u003e\n  dplyr::glimpse()\n```\n\n## Learn More?\n\nStart with the [Basic Usage](https://jbgruber.github.io/atrrr/articles/Basic_Usage.html) vignette to learn more.\n\n# Want to help?\n\nYou can help by creating an [issue](https://github.com/JBGruber/atrrr/issues/new/choose) requesting new features or reporting bugs.\n\nIf you are a developer, we are happy to accept pull requests.\nIt should be fairly straightforward, as all endpoints are already covered by automatically generated function.\nFor example, the endpoint [app.bsky.actor.getProfiles](https://docs.bsky.app/docs/api/app-bsky-actor-get-profiles) is accessible via `atrrr:::app_bsky_actor_get_profiles()`.\nThe function `get_user_info()` is just a thin wrapper around that and calls an optional parsing function:\n\n```\nget_user_info \u003c- function(actor,\n                          parse = TRUE,\n                          .token = NULL) {\n\n  # we need to use do.call so objects are passed to the right environment\n  res \u003c- do.call( \n    what = app_bsky_actor_get_profiles,\n    args = list(\n      actor,\n      .token = .token, # tokens are handled automatically under the hood\n      .return = \"json\"\n    )) |\u003e\n    purrr::pluck(\"profiles\")\n\n  if (parse) {\n    res \u003c- parse_actors(res)\n  }\n  return(res)\n}\n```\nIf you find an endpoint at \u003chttps://docs.bsky.app/docs/category/http-reference\u003e that interests you, you can write a similar wrapper and contribute it to the package (or build something new on top of it).\nBut please open an [issue](https://github.com/JBGruber/atrrr/issues) first, so we don't do duplicated work.\n\n[^1]: before 2024-01-04, this package was [called `atr`](https://github.com/JBGruber/atrrr/issues/12), meaning an R package for the AT protocol (similar to httr, which is a package for the HTTProtocol).\n  Unfortunatley, when we wanted to release the package on CRAN, the name `atr` was rejected, as a package of the same name existed some time ago.\n  So we added two \"r\" to make the package go brrr anyway!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbgruber%2Fatrrr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbgruber%2Fatrrr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbgruber%2Fatrrr/lists"}