Those who attended the UK User Group Meeting 2017 have already seen the teaser but now -sendtoslack- is also available on SSC (thanks as always to Kit Baum). What is sendtoslack? Despite its cryptic name (to most), it's very simple. This command lets you send custom notifications to your smartphone from Stata, requiring only minimal setup.
How does it work? Well, that's where the name comes from. Your message actually takes a bit of a detour before reaching your phone. First, the message is sent to Slack, an increasingly popular and highly powerful communications platform (it's free too). Then, once you install the Slack app on your smartphone, it will beep up and show this message right in front of you (assuming your phone is in front of you). The help file takes you step-by-step through the process of setting it up - you don't even technically need to create a Slack account (but please do).
Note that there's an almost unlimited number of uses for this, but the main ones will probably be the following:
Here's some examples (copied straight from the help file) of the syntax
And in case you're wondering, this is what it looks like on a smartphone. 
If you have any questions, please shoot! This is the first version, so some bugs are bound to happen. Finally, this command was inspired by -statapush- which uses the same methodology, but different apps (pushbullet, pushover and ifttt). I find slack more convenient though.
In future versions, it might be possible to send files to Slack, it's just a bit more involved.
How does it work? Well, that's where the name comes from. Your message actually takes a bit of a detour before reaching your phone. First, the message is sent to Slack, an increasingly popular and highly powerful communications platform (it's free too). Then, once you install the Slack app on your smartphone, it will beep up and show this message right in front of you (assuming your phone is in front of you). The help file takes you step-by-step through the process of setting it up - you don't even technically need to create a Slack account (but please do).
Note that there's an almost unlimited number of uses for this, but the main ones will probably be the following:
- This command can tell you when your hours/days long dofile has finished running.
- It can even tell you what the results were, or any other information that can be transmitted in plain text.
- You can also use it to inform your colleagues that your part of the process is done (e.g. they may be waiting for the price check to finish).
- You can even use it as a reminder - e.g. once the dofile is finished, tell yourself to compare the results to previous estimates. Or send an email to your boss telling him you're finally ready to take over the world.
- Always forget your wife's birthday? By messing around with profile.do you could have Stata send her a happy birthday wish on Slack automatically. Or you know, send yourself a message that you should remember to surprise her with something fun.
Here's some examples (copied straight from the help file) of the syntax
Code:
* Send default message to #webhooks channel sendtoslack * Send default message to #webhooks channel (explicitly enter URL) sendtoslack, url(https://hooks.slack.com/services/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) * Send custom message to #webhooks channel (explicitly enter URL) sendtoslack, url(https://hooks.slack.com/services/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) message("Regression one has been completed.") * Use build ** Store a url in profile.do sendtoslack, build(https://hooks.slack.com/services/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) ** Send custom message to stored url sendtoslack, message("Regression one has been completed.") * Send a message to someone else (me) sendtoslack, url(https://hooks.slack.com/services/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) m(This program is the best!)
If you have any questions, please shoot! This is the first version, so some bugs are bound to happen. Finally, this command was inspired by -statapush- which uses the same methodology, but different apps (pushbullet, pushover and ifttt). I find slack more convenient though.
In future versions, it might be possible to send files to Slack, it's just a bit more involved.
Comment