{"id":15204044,"url":"https://github.com/gesistsa/rtoot","last_synced_at":"2025-05-16T12:08:17.964Z","repository":{"id":62759392,"uuid":"562271532","full_name":"gesistsa/rtoot","owner":"gesistsa","description":":mammoth: R package to interact with the mastodon API","archived":false,"fork":false,"pushed_at":"2025-02-07T15:25:37.000Z","size":7743,"stargazers_count":104,"open_issues_count":6,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-02T00:12:16.133Z","etag":null,"topics":["mastodon","mastodon-api","rstats","rstats-package"],"latest_commit_sha":null,"homepage":"https://gesistsa.github.io/rtoot/","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/gesistsa.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-05T20:26:16.000Z","updated_at":"2025-03-22T22:11:22.000Z","dependencies_parsed_at":"2023-09-16T12:18:22.449Z","dependency_job_id":"e37dc281-bdf5-4bbb-830a-fd08c21651bd","html_url":"https://github.com/gesistsa/rtoot","commit_stats":{"total_commits":219,"total_committers":8,"mean_commits":27.375,"dds":0.4292237442922374,"last_synced_commit":"b804da6620c28f83edddacf0e63f312dfd7bf90b"},"previous_names":["gesistsa/rtoot","schochastics/rtoot"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gesistsa%2Frtoot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gesistsa%2Frtoot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gesistsa%2Frtoot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gesistsa%2Frtoot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gesistsa","download_url":"https://codeload.github.com/gesistsa/rtoot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419596,"owners_count":20936010,"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":["mastodon","mastodon-api","rstats","rstats-package"],"created_at":"2024-09-28T05:06:09.180Z","updated_at":"2025-04-09T07:05:04.417Z","avatar_url":"https://github.com/gesistsa.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    fig.path = \"man/figures/README-\",\n    out.width = \"100%\"\n)\n```\n\n# rtoot \u003cimg src=\"man/figures/logo.png\" align=\"right\"/\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/rtoot)](https://CRAN.R-project.org/package=rtoot)\n[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/rtoot)](https://CRAN.R-project.org/package=rtoot)\n[![R-CMD-check](https://github.com/gesistsa/rtoot/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/gesistsa/rtoot/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/gesistsa/rtoot/branch/main/graph/badge.svg)](https://app.codecov.io/gh/gesistsa/rtoot?branch=main)\n\n[![Codecov test coverage](https://codecov.io/gh/gesistsa/rtoot/graph/badge.svg)](https://app.codecov.io/gh/gesistsa/rtoot)\n\u003c!-- badges: end --\u003e\n\nInteract with the [mastodon API](https://docs.joinmastodon.org/api/) from R.\nGet started by reading `vignette(\"rtoot\")`.\n\nPlease cite this package as:\n\nSchoch, D. \u0026 Chan, C-h., (2023). Rtoot: Collecting and Analyzing Mastodon Data. Mobile Media \u0026 Communication, [https://doi.org/10.1177/20501579231176678](https://doi.org/10.1177/20501579231176678).\n\nFor a BibTeX entry, use the output from `citation(\"rtoot\")`.\n\n## Installation\n\nTo get the current released version from CRAN:\n\n```{r eval = FALSE}\ninstall.packages(\"rtoot\")\n```\n\n\nYou can install the development version of rtoot from GitHub:\n\n```{r install, eval=FALSE}\nremotes::install_github(\"gesistsa/rtoot\")\n```\n\n## Authenticate\n\nFirst you should set up your own credentials (see also `vignette(\"auth\")`)\n\n```{r aut, eval=FALSE}\nauth_setup()\n```\nThe mastodon API allows different access levels. Setting up a token with your own account grants you the most access.\n\n## Instances\n\nIn contrast to twitter, mastodon is not a single instance, but a federation of different servers.\nYou sign up at a specific server (say \"mastodon.social\") but can still communicate with others from other servers (say \"fosstodon.org\"). The existence of different instances makes API calls more complex.\nFor example, some calls can only be made within your own instance (e.g `get_timeline_home()`), others can access all instances but you need to specify the instance as a parameter (e.g. `get_timeline_public()`).\n\nA list of active instances can be obtained with `get_fedi_instances()`. The results are sorted by number of users.\n\nGeneral information about an instance can be obtained with `get_instance_general()`\n\n```{r, eval = FALSE}\nget_instance_general(instance = \"mastodon.social\")\n```\n\n`get_instance_activity()` shows the activity for the last three months and `get_instance_trends()` the trending hashtags of the week.\n\n```{r, eval = FALSE}\nget_instance_activity(instance = \"mastodon.social\")\nget_instance_trends(instance = \"mastodon.social\")\n```\n\n## Get toots\n\nTo get the most recent toots of a specific instance use `get_timeline_public()`\n```{r, eval = FALSE}\nget_timeline_public(instance = \"mastodon.social\")\n```\n\nTo get the most recent toots containing a specific hashtag use `get_timeline_hashtag()`\n\n```{r, eval = FALSE}\nget_timeline_hashtag(hashtag = \"rstats\", instance = \"mastodon.social\")\n```\n\nThe function `get_timeline_home()` allows you to get the most recent toots from your own timeline.\n\n```{r, eval = FALSE}\nget_timeline_home()\n```\n\n## Get accounts\n\n`rtoot` exposes several account level endpoints. Most require the account id instead of the username as an input. There is, to our knowledge, no straightforward way of obtaining the account id. With the package you can get the id via `search_accounts()`.\n\n```{r, eval=FALSE}\nsearch_accounts(\"schochastics\")\n```\n\n*(Future versions will allow to use the username and user id interchangeably)*\n\nUsing the id, you can get the followers and following users with `get_account_followers()` and\n`get_account_following()` and statuses with `get_account_statuses()`.\n\n```{r, eval = FALSE}\nid \u003c- \"109302436954721982\"\nget_account_followers(id)\nget_account_following(id)\nget_account_statuses(id)\n```\n\n\n## Posting statuses\n\nYou can post toots with:\n```{r, eval = FALSE}\npost_toot(status = \"my first rtoot #rstats\")\n```\n\nIt can also include media and alt_text.\n\n```{r, eval = FALSE}\npost_toot(\n    status = \"my first rtoot #rstats\", media = \"path/to/media\",\n    alt_text = \"description of media\"\n)\n```\n\nYou can mark the toot as sensitive by setting `sensitive = TRUE` and add a spoiler text with `spoiler_text`.\n\n*(Be aware that excessive automated posting is frowned upon (or even against the ToS) in many instances. Make sure to check the ToS of your instance and be mindful when using this function.)*\n\n## Streaming\n\n`rtoot` allows to stream statuses from three different streams.\nTo get any public status on any instance use `stream_timeline_public()`\n```{r, eval = FALSE}\nstream_timeline_public(timeout = 30, file_name = \"public.json\")\n```\nthe timeout parameter is the time in seconds data should be streamed (set to `Inf` for indefinite streaming). If just the local timeline is needed, use `local=TRUE` and set an instance (or use your own provided by the token).\n\n`stream_timeline_hashtag()` streams all statuses containing a specific hashtag\n\n```{r, eval = FALSE}\nstream_timeline_hashtag(\"rstats\", timeout = 30, file_name = \"rstats_public.json\")\n```\n\nThe statuses are directly written to file as json. The function `parse_stream()` can be used\nto read in and convert a json to a data frame.\n\n## Pagination\n\nAll relevant functions in the package support pagination of results if the `limit` parameter is larger than the default page size (which is 40 in most cases). In this case, you may get more results than requested since the pages are always fetched as a whole. If you for example request 70 records, you will get 80 back, given that many records exist.\n\n\n## Code of Conduct\n\nPlease note that the rtoot project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgesistsa%2Frtoot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgesistsa%2Frtoot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgesistsa%2Frtoot/lists"}