From 3e234bb0f60696d01f30f524419b8e56e1c4e8a2 Mon Sep 17 00:00:00 2001 From: Jon Harmon Date: Sat, 17 Aug 2024 13:05:47 -0700 Subject: [PATCH] Submission drive (#52) * Call for help And give credit on mastodon. * Update pkg versions. --- renv.lock | 8 ++++---- runner-shared.R | 3 ++- runner-toot.R | 10 ++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/renv.lock b/renv.lock index c9cf9e4..87c5b7d 100644 --- a/renv.lock +++ b/renv.lock @@ -235,7 +235,7 @@ }, "gert": { "Package": "gert", - "Version": "2.1.0", + "Version": "2.1.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -246,7 +246,7 @@ "sys", "zip" ], - "Hash": "bdc909d9f16e2478d615b0e6a7330435" + "Hash": "ab2ca7d6bd706ed218d096b7b16d7233" }, "gh": { "Package": "gh", @@ -428,13 +428,13 @@ }, "openssl": { "Package": "openssl", - "Version": "2.2.0", + "Version": "2.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "2bcca3848e4734eb3b16103bc9aa4b8e" + "Hash": "c62edf62de70cadf40553e10c739049d" }, "pillar": { "Package": "pillar", diff --git a/runner-shared.R b/runner-shared.R index 298dcba..f20d4b0 100644 --- a/runner-shared.R +++ b/runner-shared.R @@ -78,7 +78,8 @@ if (week_num == 1) { "{emoji::emoji('folder')} https://tidytues.day/{week_year}/{week_date}" ) status_msg_end <- paste( - "\n\n#RStats #PyData #JuliaLang #DataViz #tidyverse #r4ds", + "\n\nWant to help? https://github.com/rfordatascience/tidytuesday/blob/master/.github/CONTRIBUTING.md", + "\n#RStats #PyData #JuliaLang #DataViz #tidyverse #r4ds", sep = "\n" ) diff --git a/runner-toot.R b/runner-toot.R index ebbf2ae..f0bfc02 100644 --- a/runner-toot.R +++ b/runner-toot.R @@ -3,4 +3,14 @@ source("runner-shared.R", local = TRUE) # Toot. source("helpers-mastodon.R", local = TRUE) + +if (length(metadata$credit$mastodon)) { + credit <- glue::glue( + "Curator: {metadata$credit$mastodon}" + ) + if (length(credit) && (nchar(status_msg) + nchar(credit) < 500)) { + status_msg <- paste(credit, status_msg, sep = "\n") + } +} + tt_toot(status_msg, img_paths, alt_text)