Skip to content

Commit

Permalink
Update auto-posters with DSLC. (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonthegeek authored Apr 1, 2024
1 parent fe9c5c7 commit 06cefde
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion helpers-slack.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ tt_slack <- function(status_msg, status_msg_end, img_paths, alt_text) {
# We don't need the hashtags for Slack.
r4ds_msg <- stringr::str_replace(
status_msg,
"The @R4DSCommunity welcomes you",
"https://DSLC.io welcomes you",
"<!here> Welcome"
) |>
stringr::str_remove_all(status_msg_end)
Expand Down
4 changes: 1 addition & 3 deletions r4ds-helpers-mastodon.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ set_toot_content <- function(tt_toot_jon) {
"It's #TidyTuesday y'all! Show us what you made on our Slack at https://r4ds.io/join (find the #chat-tidytuesday channel)!",
"RT @jonthegeek {tt_toot_jon$url}",
"{tt_toot_jon$content}",
"Please consider a tax-deductible donation at https://r4ds.io/donate to support our work!",
.sep = "\n\n"
)

if (nchar(toot_content) > 500) {
toot_content <- glue::glue(
"It's #TidyTuesday y'all! Show us what you made on our Slack at https://r4ds.io/join (find the #chat-tidytuesday channel)!",
"RT @jonthegeek {tt_toot_jon$url}",
"#RStats #DataViz #PyData #tidyverse #r4ds",
"Please consider a tax-deductible donation at https://r4ds.io/donate to support our work!",
"#RStats #PyData #JuliaLang #DataViz #tidyverse #r4ds",
.sep = "\n\n"
)
}
Expand Down
17 changes: 5 additions & 12 deletions runner-li.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ library(httpuv)

# At least for now, we use the same image for every TT post on LinkedIn.
alt_text <- paste(
"Logo for the #TidyTuesday Project, it's the words TidyTuesday overlaying",
"Logo for the #TidyTuesday Project. The words TidyTuesday overlaying",
"a black paint splash"
)

Expand All @@ -21,20 +21,13 @@ status_msg <- stringr::str_replace_all(
"\\_"
)

# Link to R4DS in the LinkedIn format.
status_msg <- stringr::str_replace(
status_msg,
"@R4DSCommunity",
"@[R4DS Online Learning Community](urn:li:organization:65437630)"
)

# We have more room, so include more info.
status_msg <- status_msg |>
paste(
"\nNew to #TidyTuesday?",
"Welcome to the weekly social data project in R. All are welcome!",
"⬡ The event is organized by the R4DS Online Learning Community.",
"⬡ For the latest datasets, follow R4DS on Mastodon or LinkedIn",
"Welcome to the weekly social data project. All are welcome!",
"⬡ The event is organized by the Data Science Learning Community (https://dslc.io).",
"⬡ For the latest datasets, follow DSLC on Mastodon or LinkedIn",
sep = "\n"
)

Expand Down Expand Up @@ -69,7 +62,7 @@ li_post <- li_base |>
),
content = list(
media = list(
id = "urn:li:image:C5622AQET2DqAfePIaw",
id = "urn:li:image:D5622AQEHKFmWxhSlJQ",
altText = alt_text
)
),
Expand Down
8 changes: 3 additions & 5 deletions runner-shared.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ if (week_num == 1) {
"{emoji::emoji('index pointing at the viewer')} Personal metadata (TV shows watched, music listened, #RStats written, etc)",
"{emoji::emoji('question')} Whatever else you want to use!",
"\n#r4ds #tidyverse #DataViz",
"\nPlease consider a tax-deductible donation at https://r4ds.io/donate to support our work!",
.sep = "\n"
)
img_paths <- NULL
Expand Down Expand Up @@ -55,7 +54,7 @@ if (week_num == 1) {
paste(
"TidyTuesday is a weekly social data project. All are welcome to",
"participate! Please remember to share the code used to generate your",
"results!\nTidyTuesday is organized by the R4DS Online Learning",
"results!\nTidyTuesday is organized by the Data Science Learning",
"Community. Join our Slack for free online help with R and other",
"data-related topics, or to participate in a data-related book club!\n\n",
"How to Participate\nData is posted to social media every Monday",
Expand All @@ -70,13 +69,12 @@ if (week_num == 1) {
)

status_msg <- glue::glue(
"The @R4DSCommunity welcomes you to week {week_num} of #TidyTuesday!",
"https://DSLC.io welcomes you to week {week_num} of #TidyTuesday!",
" We're exploring {data_title}!\n\n",
"{emoji::emoji('folder')} https://tidytues.day/{week_year}/{week_date}"
)
status_msg_end <- paste(
"\n\n#RStats #DataViz #PyData #tidyverse #r4ds",
"Please consider a tax-deductible donation at https://r4ds.io/donate to support our work!",
"\n\n#RStats #PyData #JuliaLang #DataViz #tidyverse #r4ds",
sep = "\n"
)

Expand Down
Binary file modified tt_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tt_rules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 06cefde

Please sign in to comment.