I am on a mission to declutter my email. Once you get past the unsubscribe/filter stage, the next thing is to get the important information in a different way. Once I started down this path, however, I discovered this approach allows me to have fewer tabs open, and even concentrate more.
What is this magic? Ping your own Discord server ... wait! Let me explain!
Before we start, the tool I am using to unsubscribe from the cruft that clogs my inbox is called Unroll.me - check it out.
Now, Discord.
While joining chats might seem counter to the goal of productivity and calm, you don't have to chat with anyone.
Hence me using Discord instead of Slack. My work is full of Slack conversations and sometimes I need to close Slack and get some writing or code produced (often on a deadline). I can't use Slack to keep me informed if that is going to draw me into conversations.
My Discord server, however, can be live without anyone knowing, and can work across all my devices.
Be aware these Webhooks can send messages from anyone if they get into the wrong hands, treat it a bit like a password.
Grab your webhook using this guide.
# system library for getting the command line argument
import sys
# web library
import http.client
def send( message ):
# your webhook URL
webhookurl = "https://discordapp.com/api/webhooks/YOURWEBHOOK"
# compile the form data (BOUNDARY can be anything)
formdata = "------:::BOUNDARY:::\r\nContent-Disposition: form-data; name=\"content\"\r\n\r\n" + message + "\r\n------:::BOUNDARY:::--"
# get the connection and make the request
connection = http.client.HTTPSConnection("discordapp.com")
connection.request("POST", webhookurl, formdata, {
'content-type': "multipart/form-data; boundary=----:::BOUNDARY:::",
'cache-control': "no-cache",
})
# get the response
response = connection.getresponse()
result = response.read()
# return back to the calling function with the result
return result.decode("utf-8")
# send the messsage and print the response
print( send( sys.argv[1] ) )
To test this example script out, simply call the .py with your message as the first parameter:
Now anything that might otherwise have gone to my inbox (eg. my dev machine IP address) can instead just go into the channel, and I can see my alerts in the usual way, or check in later with selective muting.