diff --git a/.Rbuildignore b/.Rbuildignore index 9e7c176..4e44756 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -13,4 +13,12 @@ codecov.yml ^data-raw$ ^tests/testdata/malformed.json$ ^paper$ -^.editorconfig$ \ No newline at end of file +^.editorconfig$ +^CITATION\.cff$ +^install\.R$ +^postBuild$ +^apt\.txt$ +^runtime\.txt$ +^_quarto\.yml$ +^\.quarto$ +^methodshub diff --git a/.gitignore b/.gitignore index 8ff9bf4..f334f10 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ .DS_Store inst/doc docs + +/.quarto/ diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..18fa520 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,264 @@ +# -------------------------------------------- +# CITATION file created with {cffr} R package +# See also: https://docs.ropensci.org/cffr/ +# -------------------------------------------- + +cff-version: 1.2.0 +message: 'To cite package "rtoot" in publications use:' +type: software +license: MIT +title: 'rtoot: Collecting and Analyzing Mastodon Data' +version: 0.3.4.9000 +doi: 10.1177/20501579231176678 +abstract: 'An implementation of calls designed to collect and organize Mastodon data + via its Application Program Interfaces (API), which can be found at the following + URL: .' +authors: +- family-names: Schoch + given-names: David + email: david@schochastics.net + orcid: https://orcid.org/0000-0003-2952-4812 +- family-names: Chan + given-names: Chung-hong + email: chainsawtiney@gmail.com + orcid: https://orcid.org/0000-0002-6232-7530 +preferred-citation: + type: article + title: 'Rtoot: Collecting and Analyzing Mastodon Data' + authors: + - family-names: Schoch + given-names: David + email: david@schochastics.net + orcid: https://orcid.org/0000-0003-2952-4812 + - family-names: Chan + given-names: Chung-hong + email: chainsawtiney@gmail.com + orcid: https://orcid.org/0000-0002-6232-7530 + year: '2023' + url: https://github.com/gesistsa/rtoot + journal: Mobile Media & Communication + doi: 10.1177/20501579231176678 +repository: https://CRAN.R-project.org/package=rtoot +repository-code: https://github.com/gesistsa/rtoot +url: https://gesistsa.github.io/rtoot/ +contact: +- family-names: Schoch + given-names: David + email: david@schochastics.net + orcid: https://orcid.org/0000-0003-2952-4812 +keywords: +- mastodon +- mastodon-api +- rstats +- rstats-package +references: +- type: software + title: 'R: A Language and Environment for Statistical Computing' + notes: Depends + url: https://www.R-project.org/ + authors: + - name: R Core Team + institution: + name: R Foundation for Statistical Computing + address: Vienna, Austria + year: '2024' + version: '>= 3.6' +- type: software + title: clipr + abstract: 'clipr: Read and Write from the System Clipboard' + notes: Imports + url: http://matthewlincoln.net/clipr/ + repository: https://CRAN.R-project.org/package=clipr + authors: + - family-names: Lincoln + given-names: Matthew + email: matthew.d.lincoln@gmail.com + orcid: https://orcid.org/0000-0002-4387-3384 + year: '2024' +- type: software + title: curl + abstract: 'curl: A Modern and Flexible Web Client for R' + notes: Imports + url: https://jeroen.r-universe.dev/curl + repository: https://CRAN.R-project.org/package=curl + authors: + - family-names: Ooms + given-names: Jeroen + email: jeroen@berkeley.edu + orcid: https://orcid.org/0000-0002-4035-0289 + year: '2024' +- type: software + title: dplyr + abstract: 'dplyr: A Grammar of Data Manipulation' + notes: Imports + url: https://dplyr.tidyverse.org + repository: https://CRAN.R-project.org/package=dplyr + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + orcid: https://orcid.org/0000-0003-4757-117X + - family-names: François + given-names: Romain + orcid: https://orcid.org/0000-0002-2444-4226 + - family-names: Henry + given-names: Lionel + - family-names: Müller + given-names: Kirill + orcid: https://orcid.org/0000-0002-1416-3412 + - family-names: Vaughan + given-names: Davis + email: davis@posit.co + orcid: https://orcid.org/0000-0003-4777-038X + year: '2024' +- type: software + title: httr + abstract: 'httr: Tools for Working with URLs and HTTP' + notes: Imports + url: https://httr.r-lib.org/ + repository: https://CRAN.R-project.org/package=httr + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + year: '2024' +- type: software + title: jsonlite + abstract: 'jsonlite: A Simple and Robust JSON Parser and Generator for R' + notes: Imports + url: https://jeroen.r-universe.dev/jsonlite + repository: https://CRAN.R-project.org/package=jsonlite + authors: + - family-names: Ooms + given-names: Jeroen + email: jeroen@berkeley.edu + orcid: https://orcid.org/0000-0002-4035-0289 + year: '2024' +- type: software + title: tibble + abstract: 'tibble: Simple Data Frames' + notes: Imports + url: https://tibble.tidyverse.org/ + repository: https://CRAN.R-project.org/package=tibble + authors: + - family-names: Müller + given-names: Kirill + email: kirill@cynkra.com + orcid: https://orcid.org/0000-0002-1416-3412 + - family-names: Wickham + given-names: Hadley + email: hadley@rstudio.com + year: '2024' +- type: software + title: knitr + abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R' + notes: Suggests + url: https://yihui.org/knitr/ + repository: https://CRAN.R-project.org/package=knitr + authors: + - family-names: Xie + given-names: Yihui + email: xie@yihui.name + orcid: https://orcid.org/0000-0003-0645-5666 + year: '2024' +- type: software + title: rmarkdown + abstract: 'rmarkdown: Dynamic Documents for R' + notes: Suggests + url: https://pkgs.rstudio.com/rmarkdown/ + repository: https://CRAN.R-project.org/package=rmarkdown + authors: + - family-names: Allaire + given-names: JJ + email: jj@posit.co + - family-names: Xie + given-names: Yihui + email: xie@yihui.name + orcid: https://orcid.org/0000-0003-0645-5666 + - family-names: Dervieux + given-names: Christophe + email: cderv@posit.co + orcid: https://orcid.org/0000-0003-4474-2498 + - family-names: McPherson + given-names: Jonathan + email: jonathan@posit.co + - family-names: Luraschi + given-names: Javier + - family-names: Ushey + given-names: Kevin + email: kevin@posit.co + - family-names: Atkins + given-names: Aron + email: aron@posit.co + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + - family-names: Cheng + given-names: Joe + email: joe@posit.co + - family-names: Chang + given-names: Winston + email: winston@posit.co + - family-names: Iannone + given-names: Richard + email: rich@posit.co + orcid: https://orcid.org/0000-0003-3925-190X + year: '2024' +- type: software + title: testthat + abstract: 'testthat: Unit Testing for R' + notes: Suggests + url: https://testthat.r-lib.org + repository: https://CRAN.R-project.org/package=testthat + authors: + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + year: '2024' + version: '>= 3.0.0' +- type: software + title: rstudioapi + abstract: 'rstudioapi: Safely Access the RStudio API' + notes: Suggests + url: https://rstudio.github.io/rstudioapi/ + repository: https://CRAN.R-project.org/package=rstudioapi + authors: + - family-names: Ushey + given-names: Kevin + email: kevin@rstudio.com + - family-names: Allaire + given-names: JJ + email: jj@posit.co + - family-names: Wickham + given-names: Hadley + email: hadley@posit.co + - family-names: Ritchie + given-names: Gary + email: gary@posit.co + year: '2024' +- type: software + title: vcr + abstract: 'vcr: Record ''HTTP'' Calls to Disk' + notes: Suggests + url: https://github.com/ropensci/vcr/ + repository: https://CRAN.R-project.org/package=vcr + authors: + - family-names: Chamberlain + given-names: Scott + email: sckott@protonmail.com + orcid: https://orcid.org/0000-0003-1444-9135 + - family-names: Wolen + given-names: Aaron + orcid: https://orcid.org/0000-0003-2542-2202 + - family-names: Salmon + given-names: Maëlle + orcid: https://orcid.org/0000-0002-2815-0399 + - family-names: Possenriede + given-names: Daniel + orcid: https://orcid.org/0000-0002-6738-9845 + year: '2024' + version: '>= 0.6.0' +identifiers: +- type: url + value: https://github.com/gesistsa/rtoot/ + diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..94b367f --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,5 @@ +project: + title: rtoot + type: default + render: + - methodshub.qmd diff --git a/apt.txt b/apt.txt new file mode 100644 index 0000000..a18b53c --- /dev/null +++ b/apt.txt @@ -0,0 +1 @@ +zip \ No newline at end of file diff --git a/install.R b/install.R new file mode 100644 index 0000000..7c130d8 --- /dev/null +++ b/install.R @@ -0,0 +1 @@ +install.packages("rtoot") diff --git a/methodshub.md b/methodshub.md new file mode 100644 index 0000000..1d61f93 --- /dev/null +++ b/methodshub.md @@ -0,0 +1,141 @@ +# rtoot - Collecting and Analyzing Mastodon Data + + +## Description + + + +An implementation of calls designed to collect and organize Mastodon +data via its Application Program Interfaces (API), which can be found at +the following URL: . + +## Keywords + + + +- Mastodon +- Decentralized Social Network +- Social Media Data + +## Science Usecase(s) + + + + +Although not using this package, the data from the Mastodon API has been +used in various social science publications on platform migration +(e.g. [La Cava et al. 2023](https://doi.org/10.1038/s41598-023-48200-7)) +and online network formation (e.g. [La Cava, et +al. 2021](https://doi.org/10.1007/s41109-021-00392-5)). + +## Repository structure + +This repository follows [the standard structure of an R +package](https://cran.r-project.org/doc/FAQ/R-exts.html#Package-structure). + +## Environment Setup + +With R installed: + +``` r +install.packages("rtoot") +``` + + + + + +## Input Data + + + + +No applicable. + +## Sample Input and Output Data + + + + +As a data collection software, this tool does not have any “sample +input”. + +The output from this software is a [standard +tibble](https://cran.r-project.org/package=tibble) of data collected +from the Mastodon API. + +## How to Use + + + + +Please refer to the [“Introduction to +rtoot”](https://gesistsa.github.io/rtoot/articles/rtoot.html) for a +comprehensive introduction of the package. + +In general, one should first conduct the authentication to obtain an +access token. This can be done with the provided function +`auth_setup()`. For more information, please refer to the documentation +on +[authentication](https://gesistsa.github.io/rtoot/articles/auth.html). + +However, it is also possible to use some of functions with +authentication. For example, it is possible to obtain the public +timeline of a Mastodon instance, e.g. emacs.ch. + +``` r +library(rtoot) +get_timeline_public(instance = "emacs.ch") +``` + + # A tibble: 20 × 29 + id uri created_at content visibility sensitive spoiler_text + + 1 11264208… http… 2024-06-19 07:23:24 "

Wh… public FALSE "" + 2 11264208… http… 2024-06-19 07:23:19 "

L'… public FALSE "" + 3 11264208… http… 2024-06-19 07:23:05 "

Wo… public FALSE "" + 5 11264208… http… 2024-06-19 07:22:59 "

Ja… public FALSE "" + 6 11264208… http… 2024-06-19 07:22:54 "

Al… public FALSE "" + 7 11264208… http… 2024-06-19 07:04:28 "

Ru… public FALSE "" + 8 11264208… http… 2024-06-19 07:22:35 "

Re… public FALSE "" + 9 11264208… http… 2024-06-19 07:22:27 "

🎶… public FALSE "" + 10 11264208… http… 2024-06-19 07:22:23 "

Ne… public FALSE "" + 11 11264208… http… 2024-06-19 07:22:19 "

I … public FALSE "" + 12 11264207… http… 2024-06-19 07:22:11 "

Gi… public FALSE "" + 15 11264207… http… 2024-06-19 07:22:00 "

\"… public FALSE "" + 16 11264207… http… 2024-06-19 07:21:58 "

Fe… public FALSE "" + 17 11264207… http… 2024-06-19 07:21:48 "Wow i… public FALSE "" + 18 11264207… http… 2024-06-19 07:21:49 "

Sy… public FALSE "" + 19 11264207… http… 2024-06-19 07:21:29 ", favourites_count , + # replies_count , url , in_reply_to_id , + # in_reply_to_account_id , language , text , + # application >, poll >, card >, account , + # reblog >, media_attachments >, mentions >, + # tags >, emojis >, favourited , reblogged , + # muted , bookmarked , pinned + +Other functions, e.g. `get_timeline_hashtag()`, `get_account_statuses()` +require authentication. + +## Contact Details + +Maintainer: David Schoch + +Issue Tracker: + +## Publication + +1. Schoch, D., & Chan, C. H. (2023). Software presentation: Rtoot: + Collecting and analyzing Mastodon data. Mobile Media & + Communication, 11(3), 575-578. + https://doi.org/10.1177/20501579231176678 + + + + + diff --git a/methodshub.qmd b/methodshub.qmd new file mode 100644 index 0000000..4149597 --- /dev/null +++ b/methodshub.qmd @@ -0,0 +1,95 @@ +--- +title: rtoot - Collecting and Analyzing Mastodon Data +format: + html: + embed-resources: true + gfm: default +--- + +## Description + + + +An implementation of calls designed to collect and organize Mastodon data via its Application Program Interfaces (API), which can be found at the following URL: . + +## Keywords + + + +* Mastodon +* Decentralized Social Network +* Social Media Data + +## Science Usecase(s) + + + + +Although not using this package, the data from the Mastodon API has been used in various social science publications on platform migration (e.g. [La Cava et al. 2023](https://doi.org/10.1038/s41598-023-48200-7)) and online network formation (e.g. [La Cava, et al. 2021](https://doi.org/10.1007/s41109-021-00392-5)). + +## Repository structure + +This repository follows [the standard structure of an R package](https://cran.r-project.org/doc/FAQ/R-exts.html#Package-structure). + +## Environment Setup + +With R installed: + +```r +install.packages("rtoot") +``` + + + + + + +## Input Data + + + + +No applicable. + +## Sample Input and Output Data + + + + +As a data collection software, this tool does not have any "sample input". + +The output from this software is a [standard tibble](https://cran.r-project.org/package=tibble) of data collected from the Mastodon API. + +## How to Use + + + + +Please refer to the ["Introduction to rtoot"](https://gesistsa.github.io/rtoot/articles/rtoot.html) for a comprehensive introduction of the package. + +In general, one should first conduct the authentication to obtain an access token. This can be done with the provided function `auth_setup()`. For more information, please refer to the documentation on [authentication](https://gesistsa.github.io/rtoot/articles/auth.html). + +However, it is also possible to use some of functions with authentication. For example, it is possible to obtain the public timeline of a Mastodon instance, e.g. emacs.ch. + +```{r} +library(rtoot) +get_timeline_public(instance = "emacs.ch") +``` + +Other functions, e.g. `get_timeline_hashtag()`, `get_account_statuses()` require authentication. + +## Contact Details + +Maintainer: David Schoch + +Issue Tracker: [https://github.com/gesistsa/rtoot/issues](https://github.com/gesistsa/rtoot/issues) + +## Publication + +1. Schoch, D., & Chan, C. H. (2023). Software presentation: Rtoot: Collecting and analyzing Mastodon data. Mobile Media & Communication, 11(3), 575-578. https://doi.org/10.1177/20501579231176678 + + + + + + diff --git a/postBuild b/postBuild new file mode 100644 index 0000000..942913e --- /dev/null +++ b/postBuild @@ -0,0 +1,62 @@ +#!/bin/bash -v + +# determine which version of Quarto to install +QUARTO_VERSION=1.4.551 + +# See whether we need to lookup a Quarto version +if [ $QUARTO_VERSION = "prerelease" ]; then + QUARTO_JSON="_prerelease.json" +elif [ $QUARTO_VERSION = "release" ]; then + QUARTO_JSON="_download.json" +fi + +if [ $QUARTO_JSON != "" ]; then + +# create a python script and run it +PYTHON_SCRIPT=_quarto_version.py +if [ -e $PYTHON_SCRIPT ]; then + rm -rf $PYTHON_SCRIPT +fi + +cat > $PYTHON_SCRIPT <