Skip to content

Commit

Permalink
Toot as DSLC. (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonthegeek authored Apr 30, 2024
1 parent 290f59b commit 4541a32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/retoot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
post:
runs-on: windows-latest
env:
RTOOT_R4DS_TOKEN: ${{ secrets.RTOOT_R4DS_TOKEN }}
RTOOT_DSLC_TOKEN: ${{ secrets.RTOOT_DSLC_TOKEN }}
GITHUB_PAT: ${{ secrets.GH_PAT }}
steps:
- uses: actions/checkout@v4
Expand All @@ -21,4 +21,4 @@ jobs:
with:
cache-version: 2
- name: Toot.
run: Rscript r4ds-retoot.R
run: Rscript dslc-retoot.R
4 changes: 2 additions & 2 deletions dslc-helpers-mastodon.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sys.setenv(RTOOT_DEFAULT_TOKEN = Sys.getenv("RTOOT_R4DS_TOKEN"))
Sys.setenv(RTOOT_DEFAULT_TOKEN = Sys.getenv("RTOOT_DSLC_TOKEN"))

get_jon_toot <- function() {
jon_toot <- rtoot::get_account_statuses(
Expand Down Expand Up @@ -88,7 +88,7 @@ set_toot_content <- function(tt_toot_jon) {
return(toot_content)
}

rtoot_token_from_envvar <- function(envvar = "RTOOT_R4DS_TOKEN") {
rtoot_token_from_envvar <- function(envvar = "RTOOT_DSLC_TOKEN") {
rlang::set_names(
as.list(strsplit(x = Sys.getenv(envvar), split = ";")[[1]]),
c("bearer", "type", "instance")
Expand Down
4 changes: 2 additions & 2 deletions helpers-slack.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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(
dslc_msg <- stringr::str_replace(
status_msg,
"https://DSLC.io welcomes you",
"<!here> Welcome"
Expand All @@ -9,7 +9,7 @@ tt_slack <- function(status_msg, status_msg_end, img_paths, alt_text) {

posted <- slackcalls::post_slack(
slack_method = "chat.postMessage",
text = r4ds_msg,
text = dslc_msg,
channel = "C0106FDAE74" # chat-tidytuesday
)

Expand Down

0 comments on commit 4541a32

Please sign in to comment.