Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.98 KB

readme.md

File metadata and controls

46 lines (33 loc) · 1.98 KB

Daily theme

Set the user responsible for picking tomorrow's daily theme. Rotate evenly over the calendar year weekdays.

Setter is

  • is annonced to the random channel.
  • sent a DM from the bot with a suggested theme (and giphy).

Suggested theme list from |themes.txt|https://literarydevices.net/a-huge-list-of-common-themes/| |catchphrases.txt|https://en.wikipedia.org/wiki/List_of_catchphrases_in_American_and_British_mass_media#In_American_television| |athletics.txt|https://en.wikipedia.org/wiki/Lists_of_Olympic_medalists https://www.atlasobscura.com/articles/18-obscure-sports-worth-rooting-for|

Using

Should be run from cron weekday afternoons (a la crontab -e):

00 17 * * 1,2,3,4,5 /path/to/slacktheme_bot/bot.pl
  • .oauth and .giphy are untracked files with the key/token to use for slack and giphy respectively.
  • perl depends: cpanm Class::Tiny WebService::Slack::WebApi

Auth

  • create using https://api.slack.com/apps/
  • paste "Bot User Oauth Access Token" into .oauth
  • scopes: need chat:write and chat:write.public
  • users:read is useful for discovering user IDs (see Makefile)

Attic

Previously manually set themes would come from github. This is still posibile, but no longer useful.

Setting theme

bot does a git pull before looking for a theme. if manual-theme.txt has been modified, text in that file will be used as a theme.

Github enables editting the manual theme on the web!

Cron

on foranw@rhea: crontab -l|grep slack is

 # 00 08 * * 1,2,3,4,5 /opt/ni_tools/slacktheme_bot/bot.pl random 2> /tmp/theme_bot.log
00 08 * * 1  /opt/ni_tools/slacktheme_bot/lncdgit_summary |  OPENSSL_CONF="/opt/ni_tools/slacktheme_bot/openssl.conf" /opt/ni_tools/slacktheme_bot/slack-msg codereview 
00 12 * * 5  /opt/ni_tools/slacktheme_bot/lncdwiki_weekly_summary | OPENSSL_CONF="/opt/ni_tools/slacktheme_bot/openssl.conf" /opt/ni_tools/slacktheme_bot/slack-msg random