| Title: | Manage rOpenSci Social Contacts |
|---|---|
| Description: | Tools to find and keep track of contact info and social media handles of rOpenSci community members. |
| Authors: | Steffi LaZerte |
| Maintainer: | Steffi LaZerte <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-08-13 10:40:14 UTC |
| Source: | https://github.com/ropensci-org/monarch |
Find and insert missing social media handles
add_handles( df, primary = "github", which_cols = c("github", "name", "mastodon", "linkedin"), pkg_col = "pkg", owner_col = "owner", prefix = NULL, force_masto = FALSE, force = FALSE )add_handles( df, primary = "github", which_cols = c("github", "name", "mastodon", "linkedin"), pkg_col = "pkg", owner_col = "owner", prefix = NULL, force_masto = FALSE, force = FALSE )
df |
Data frame with columns appended with '_name', '_github', '_mastodon'. |
primary |
Character. Either "github" or "name", which ever column is the primary column by which social handles should be fetched. |
which_cols |
Character vector. Social columns to return, any of "github", "name", "mastodon", "linkedin". |
pkg_col |
Character. Name of the "pkg" column. Optional but recommended for fetching by name. |
owner_col |
Character. Name of the column containing repository owners for packages ('pkg_col'). Optional but recommended for fetching by name. |
prefix |
Character. Optional prefix on column names (e.g. "maintainer_" for "maintainer_github", "matinainer_name", etc.) |
force_masto |
Logical. Whether to force an update of the Mastodon handle. |
force |
Logical. Whether to force an update of all handles. |
Data frame with added names and social media handles.
d <- data.frame(author_name = "Steffi LaZerte") add_handles(d, primary = "name", prefix = "author_") d <- data.frame( author_name = "Steffi LaZerte", pkg = "weathercan", owner = "ropensci", author_github = "steffilazerte" ) add_handles( d, primary = "name", prefix = "author_", pkg_col = "pkg", owner_col = "owner", which_cols = "github" ) add_handles( d, primary = "name", prefix = "author_", pkg_col = "pkg", owner_col = "owner" ) d <- data.frame(github = "steffilazerte") add_handles(d) # If all complete, do not overwrite unless force == TRUE d <- data.frame( github = "steffilazerte", name = "test", mastodon = "test", linkedin = "test" ) add_handles(d) add_handles(d, force = TRUE) # Use name for linked in (always) d <- data.frame(github = "steffilazerte", name = "test", mastodon = "test") add_handles(d) # If not all complete, will overwrite... d <- data.frame(github = "steffilazerte", name = "test") add_handles(d)d <- data.frame(author_name = "Steffi LaZerte") add_handles(d, primary = "name", prefix = "author_") d <- data.frame( author_name = "Steffi LaZerte", pkg = "weathercan", owner = "ropensci", author_github = "steffilazerte" ) add_handles( d, primary = "name", prefix = "author_", pkg_col = "pkg", owner_col = "owner", which_cols = "github" ) add_handles( d, primary = "name", prefix = "author_", pkg_col = "pkg", owner_col = "owner" ) d <- data.frame(github = "steffilazerte") add_handles(d) # If all complete, do not overwrite unless force == TRUE d <- data.frame( github = "steffilazerte", name = "test", mastodon = "test", linkedin = "test" ) add_handles(d) add_handles(d, force = TRUE) # Use name for linked in (always) d <- data.frame(github = "steffilazerte", name = "test", mastodon = "test") add_handles(d) # If not all complete, will overwrite... d <- data.frame(github = "steffilazerte", name = "test") add_handles(d)
Checks for the presence of a cache dir. If interactive and not present, asks user if it should be created. If non-interactive and not present, it is created automatically.
cache_check()cache_check()
Logical. TRUE if it exists, FALSE if not.
cache_check()cache_check()
Fetch all details on a social contact
cocoon_fetch(value, type = "github")cocoon_fetch(value, type = "github")
value |
Character. Value to search by |
type |
Character. Type of 'value' (e.g., "github" for github handle) |
Data frame of socials
cocoon_fetch("steffilazerte") cocoon_fetch("steffi LaZerte", type = "name")cocoon_fetch("steffilazerte") cocoon_fetch("steffi LaZerte", type = "name")
Reads your local socials data for perusal or modification.
cocoon_open()cocoon_open()
Socials data frame
cocoon_open()cocoon_open()
Remove Socials by GitHub handle
cocoon_remove(github)cocoon_remove(github)
github |
Character. Github username |
Socials data frame
cocoon_fetch("steffilazerte") cocoon_remove("steffilazerte") cocoon_fetch("steffilazerte")cocoon_fetch("steffilazerte") cocoon_remove("steffilazerte") cocoon_fetch("steffilazerte")
Save/Update your local copy of the contact information.
cocoon_update(socials, type = NULL, value = NULL)cocoon_update(socials, type = NULL, value = NULL)
socials |
Data frame. Data frame of previously fetched/loaded social contact information. Data frame with three columns 'type', 'value' and 'github' to indicate the type and value of the contact information and the GitHub username identifying the individual. |
type |
Character. Type of 'value' (e.g., "github" for github handle) |
value |
Character. Value to search by |
Nothing
socials_fetch("steffilazerte") |> cocoon_update() # Or directly cocoon_update("steffilazerte") # Or add parts cocoon_update("steffilazerte", type = "name", value = "Stefanie LaZerte")socials_fetch("steffilazerte") |> cocoon_update() # Or directly cocoon_update("steffilazerte") # Or add parts cocoon_update("steffilazerte", type = "name", value = "Stefanie LaZerte")
Fetches a single value from your local socials data frame.
fetch(values, type = "mastodon", n = 1)fetch(values, type = "mastodon", n = 1)
values |
Character. Values of social data to match by. |
type |
Character. Type of social data to fetch. |
n |
Numeric. Maximum number of matches per value to return. |
Character string of the value of the type of data requested
fetch("Steffi LaZerte", type = "linkedin") fetch(c("Steffi LaZerte", NA, "Yanina Bellini Saibene")) fetch("steffilazerte") fetch("Maëlle Salmon", type = "github")fetch("Steffi LaZerte", type = "linkedin") fetch(c("Steffi LaZerte", NA, "Yanina Bellini Saibene")) fetch("steffilazerte") fetch("Maëlle Salmon", type = "github")
Convert a mastodon user link to handle
fmt_masto(x)fmt_masto(x)
x |
Character. Link to user's profile |
Character user handle @user@instance
fmt_masto("https://fosstodon.org/@steffilazerte") fmt_masto("steffi lazerte") fmt_masto("@[email protected]") fmt_masto(NA) fmt_masto(c("https://fosstodon.org/@steffilazerte", "https://hackyderm.io/@ropensci")) fmt_masto("none")fmt_masto("https://fosstodon.org/@steffilazerte") fmt_masto("steffi lazerte") fmt_masto("@[email protected]") fmt_masto(NA) fmt_masto(c("https://fosstodon.org/@steffilazerte", "https://hackyderm.io/@ropensci")) fmt_masto("none")
Look up users of a repository and match to a name. Try with and without initials.
gh_search(name, pkg = NULL, owner = "ropensci", open_browser = interactive())gh_search(name, pkg = NULL, owner = "ropensci", open_browser = interactive())
name |
Character. Full or partial name of the person for whom you want to fetch the GitHub username. |
pkg |
Character. (Optional) Repository name (package name). |
owner |
Character. (Optional) Owner of the repository. |
open_browser |
Logical. Whether to open the profile page in a browser for confirmation. |
Accepted user name
gh_search(name = "Steffi E. LaZerte", pkg = "weathercan") gh_search(name = "Steffi", pkg = "weathercan")gh_search(name = "Steffi E. LaZerte", pkg = "weathercan") gh_search(name = "Steffi", pkg = "weathercan")
Skip examples on CI or R-Universe
local_eg()local_eg()
Convert a mastodon user link to handle
masto2user(x)masto2user(x)
x |
Character. Link to user's profile |
Character user handle @user@instance
masto2user("https://fosstodon.org/@steffilazerte") masto2user("steffi") masto2user("@[email protected]") masto2user(NA)masto2user("https://fosstodon.org/@steffilazerte") masto2user("steffi") masto2user("@[email protected]") masto2user(NA)
Using a GitHub username fetch the contact information from their profile.
socials_gh(github, quiet = FALSE)socials_gh(github, quiet = FALSE)
github |
Character. Github username |
quiet |
Logical. Whether to suppress progress messages. |
Data frame of social contact information. Three columns 'type', 'value' and 'github' to indicate the type and value of the contact information and the GitHub username identifying the individual.
socials_gh("steffilazerte")socials_gh("steffilazerte")
Useful if neither GitHub nor the rOpenSci author pages contain a Mastodon handle. Because this can take a bit of time, if a mastodon handle is detected in the 'socials' data frame, 'socials_masto()' will skip the search, unless 'force = TRUE'. Useful if you think the handle is incorrect.
socials_masto( socials = NULL, names = NULL, github = NULL, force = FALSE, open_browser = interactive(), quiet = FALSE )socials_masto( socials = NULL, names = NULL, github = NULL, force = FALSE, open_browser = interactive(), quiet = FALSE )
socials |
Data frame. Data frame of previously fetched/loaded social contact information. Data frame with three columns 'type', 'value' and 'github' to indicate the type and value of the contact information and the GitHub username identifying the individual. |
names |
Character. Names to fetch by. |
github |
Character. Github username |
force |
Logical. Whether to force a search even if the handle already exists. |
open_browser |
Logical. Whether to open the profile page in a browser for confirmation. |
quiet |
Logical. Whether to suppress progress messages. |
Unlike most other functions, 'socials_masto()' permits searching for a handle by name without providing a 'socials' data frame or a 'github' handle. In this case, the Mastodon handle is returned as a character string and not as a socials data frame.
If 'socials' or 'github' are provided, a data frame of social contact information. Three columns 'type', 'value' and 'github' to indicate the type and value of the contact information and the GitHub username identifying the individual. Otherwise a character string of the mastodon handle.
socials_gh("steffilazerte") |> socials_masto(force = TRUE) socials_masto(github = "steffilazerte") socials_masto(names = "steffi") socials_masto(names = "steffi", github = "steffilazerte")socials_gh("steffilazerte") |> socials_masto(force = TRUE) socials_masto(github = "steffilazerte") socials_masto(names = "steffi") socials_masto(names = "steffi", github = "steffilazerte")
Once initial contact information has been sourced via 'socials_gh()', we can add to this by looking for additional details on the rOpenSci author pages (<https://ropensci.org/author>).
socials_ro(socials = NULL, names = NULL, github = NULL, quiet = FALSE)socials_ro(socials = NULL, names = NULL, github = NULL, quiet = FALSE)
socials |
Data frame. Data frame of previously fetched/loaded social contact information. Data frame with three columns 'type', 'value' and 'github' to indicate the type and value of the contact information and the GitHub username identifying the individual. |
names |
Character. Optional, supply the full name as on RO author pages. (Doesn't require the socials data frame) |
github |
Character. Github username |
quiet |
Logical. Whether to suppress progress messages. |
By default 'socials_ro()' will use the 'name' stored in the 'socials' data frame.
If you know this doesn't match exactly that on the rOpenSci author pages, you can supply an alternative with 'name'. Ideally however, you would add an additional name to the socials data frame to keep track of minor variations in names.
Data frame of social contact information. Three columns 'type', 'value' and 'github' to indicate the type and value of the contact information and the GitHub username identifying the individual.
socials_gh("steffilazerte") |> socials_ro() socials_ro(names = c("Stefanie LaZerte", "Steffi LaZerte"))socials_gh("steffilazerte") |> socials_ro() socials_ro(names = c("Stefanie LaZerte", "Steffi LaZerte"))
'socials_update()' takes an existing social data frame and adds or updates new values. Only certain data types are permitted to have more than one value (i.e. names and websites). In all other cases, if there is more than one handle or id value, you will be asked to choose one to keep.
socials_update(socials, socials_new = NULL, type = NULL, value = NULL)socials_update(socials, socials_new = NULL, type = NULL, value = NULL)
socials |
Data frame. Data frame of previously fetched/loaded social contact information. Data frame with three columns 'type', 'value' and 'github' to indicate the type and value of the contact information and the GitHub username identifying the individual. |
socials_new |
Data frame. New data to add/update. If adding only a single value, use 'type' and 'value' instead. |
type |
Character. Type of data to add (to add a single value, alternative to 'socials_new') |
value |
Character. Value of data to add (to add a single value, alternative to 'socials_new'). |
Socials data frame with new values
socials_fetch("steffilazerte") |> socials_update(type = "name", value = "Stefanie LaZerte") # Add an aliassocials_fetch("steffilazerte") |> socials_update(type = "name", value = "Stefanie LaZerte") # Add an alias
Fetch contact information from social media
Description
This is a wrapper around the three 'socials_xxx()' functions. 'socials_gh()' starts (ideally) with a GitHub username to fetch contact info from GitHub, followed by 'socials_ro()' which checks rOpenSci author pages and finally, if Mastodon handles have not been found 'socials_masto()'.
Usage
Arguments
githubCharacter. Github username
nameCharacter. Alternatively, a full name (can be slow if 'pkg' not also provided).
pkgCharacter. Repository name for an rOpenSci package (in the 'ropensci' organization)
ownerCharacter. (Optional) Owner of the repository.
which_colsCharacter vector. Social handles to include defaults to "github", "name", "mastodon".
force_mastoLogical. Whether to force a re-fetching of Mastodon handles.
quietLogical. Whether to suppress progress messages.
Details
This workflow generally assumes that the person has a GitHub username. You can supply name, which will trigger a search for the GitHub username for you. This will search all of the rOpenSci organization for users with that name which can take a while. However, if you supply a name and a 'pkg' (repository in rOpenSci), it can be much faster.
Value
Data frame of contact information
Examples