Skip to content

Instantly share code, notes, and snippets.

@awwaiid
Created April 26, 2017 16:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save awwaiid/d83c8461691a48f09e71470a3d5b157d to your computer and use it in GitHub Desktop.
#!/bin/sh
# Fill in your slack token (the bad way), and then this will
# set your status text/emoticon to the current hour of the day!
#
# After testing, put this in your contrab like:
# 0 * * * * /path/to/slack-clock.sh >/dev/null 2>&1
token="..."
hour=`date '+%I' | perl -pe 's/^0//'`
text="$hour%20o%27clock"
emoji="clock$hour"
echo "$text: $emoji"
curl -s "https://slack.com/api/users.profile.set?token=$token&profile=%7B%20%22status_text%22%3A%20%22$text%22%2C%20%22status_emoji%22%3A%20%22%3A$emoji%3A%22%20%7D&pretty=1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment