@@ -196,9 +196,9 @@ cw_times <- function(details) {
196196# ' schedule).
197197# '
198198# ' @param date Character/Date. Date of the coworking event (local)
199- # ' @param who_masto Character. The full mastodon handle for the cohost (i.e. [email protected] )200- # ' @param who_slack Character. The full Slack handle for the cohost (i.e. @XXXX )
201- # ' @param who_linkedin Character. The full LinkedIn handle for the cohost (i.e. @XXXX)
199+ # ' @param who_masto Character. The full mastodon handle for the cohost (i.e. ` [email protected] ` )200+ # ' @param who_slack Character. The full API Slack id for the cohost (i.e. `<@UXXXXXXX>` )
201+ # ' @param who_linkedin Character. The full LinkedIn handle for the cohost (i.e. ` @XXXX` )
202202# ' @param who_main_masto Character. The full mastodon handle for the rOpenSci staff organizer.
203203# ' @param who_main_slack Character. The Slack id for the rOpenSci staff
204204# ' organizer (i.e., `<@UXXXXXXX>`. Defaults to Steffi's id.
@@ -250,7 +250,9 @@ cw_socials <- function(date, who_masto, who_slack, who_linkedin,
250250 yaml_end = purrr :: map_dbl(.data $ content , \(x ) stringr :: str_which(x , " ---" )[2 ]),
251251 yaml = purrr :: map2(.data $ content , .data $ yaml_end , \(x , y ) x [1 : y ] | > paste0(collapse = " \n " )))
252252
253- tz <- stringr :: str_extract(event $ content [[1 ]], " (America/Vancouver)|(Europe/Paris)|(Australia/Perth)" ) | >
253+ tz <- stringr :: str_extract(
254+ event $ content [[1 ]],
255+ " (America/Vancouver)|(Europe/Paris)|(Australia/Perth)" ) | >
254256 stats :: na.omit()
255257
256258 if (! tz %in% OlsonNames()) stop(" Couldn't detect timezone" , call. = FALSE )
@@ -365,27 +367,42 @@ cw_slack_week <- function(x, posters_tz, dry_run = FALSE) {
365367
366368 time_post <- x | >
367369 dplyr :: mutate(
368- time_post = .data $ date_local - lubridate :: weeks(1 ),
370+ time_post = .data $ date_local - lubridate :: weeks(2 ),
369371 time_post = lubridate :: with_tz(.data $ time_post , .env $ posters_tz )) | >
370372 dplyr :: pull(time_post )
371373
372374 body <- x | >
373375 glue :: glue_data(
374- # "[SLACK WEEK BEFORE: #general & #co-working]",
375- # "[POST AT: {time_post}]",
376- # "\n",
377376 " Join us for Social Coworking and office hours next week!" ,
378377 " " ,
379378 " :grey_exclamation: Theme: {theme}" ,
380379 " :hourglass_flowing_sand: When: {time}" ,
381380 " :cookie: Hosted by: {who_main_slack} and community host {who_slack}" ,
381+ " :mag: Details: {event_url}" ,
382+ " " ,
383+ " You can use this time for..." ,
384+ " - General coworking" ,
385+ " {action1}" ,
386+ " - Chat with {who_slack} and other attendees about our theme!" ,
387+ " " ,
388+ .sep = " \n " ) | >
389+ fmt_slack()
390+
391+ # Use linkedin (i.e. Full names)
392+ body_sister <- x | >
393+ glue :: glue_data(
394+ " Join us for Social Coworking and office hours next week!" ,
395+ " " ,
396+ " :grey_exclamation: Theme: {theme}" ,
397+ " :hourglass_flowing_sand: When: {time}" ,
398+ " :cookie: Hosted by: @{who_main_linkedin} and community host @{who_linkedin}" ,
399+ " :mag: Details: {event_url}" ,
382400 " " ,
383401 " You can use this time for..." ,
384402 " - General coworking" ,
385403 " {action1}" ,
386- " - Chat with {who_slack } and others about our theme!" ,
404+ " - Chat with @{who_linkedin } and other attendees about our theme!" ,
387405 " " ,
388- " {event_url}" ,
389406 .sep = " \n " ) | >
390407 fmt_slack()
391408
@@ -395,14 +412,18 @@ cw_slack_week <- function(x, posters_tz, dry_run = FALSE) {
395412 slack_posts_write(body , when = time_post , tz = posters_tz , channel = " #general" )
396413 slack_posts_write(body , when = time_post , tz = posters_tz , channel = " #co-working" )
397414 }
415+
416+ clipr :: write_clip(body_sister )
417+ cli :: cli_alert_success(" Copied Sister-Slack messages to clipboard" )
418+ cli :: cli_alert_info(paste0(" Post on " , time_post ))
419+ cli :: cli_code(body_sister )
398420}
399421
400422fmt_slack <- function (body ) {
401423 stringr :: str_replace_all(
402424 body , " \\ [(.+)\\ ]\\ ((.+)\\ )" , " <\\ 2|\\ 1>" )
403425}
404426
405-
406427# ' Schedule 1-hour before messages on rOpenSci Slack
407428# '
408429# ' Will only work if running between the time that the 1-week message was posted
0 commit comments