Title

statapush - Stata module for sending push notifications

Syntax

statapush [using filename], token(string) userid(string) message(string) [attachment(string)] [provider(string)]

Description

statapush is compatible with Stata v12.1+. While it may be compatible with earlier versions, it has not been tested in those environments.

statapush requires cURL, an open source command line tool and library. cURL is installed by default on computers using Mac OS and Unix, but requires manual installation for Windows.

statapush also requires use of the free push notification service Pushbullet, Pushover or IFTTT.

For Pushbullet

1. Create a free Pushbullet account.

2. Create an API token under account settings by clicking "Create Access Token."

3. Install the Pushbullet client on your device (Android, iOS, or Desktop).

For Pushover

1. Create a free Pushover account.

2. Register a new Pushover application. Choose any name for the application (e.g., StataPush) and select "Application" under the "Type" dropdown.

3. Install the Pushover client on your device (Android, iOS, or Desktop).

For IFTTT

1. Create a free IFTTT account.

2. Set up an IFTTT Maker Channel.

3. Add the StataPush SMS, email or IF recipe depending on which type of notification you would like to use. Be sure the recipe event name is "StataPush".

Options

Note: All three arguments below are required.

token(string) Use this option to provide your Pushbullet, Pushover, or IFTTT token.

userid(string) Use this option to provide your Pushbullet username (email address), Pushover user key, or IFTTT username (email address).

message(string) Use this option to specify the message you would like included in your push notification.

Note: The following arguments are not required.

attachment(string) Use this option to specify the file path for the attachment you would like included with your notification. This option is only compatible with Pushbullet.

provider(string) Use this option to specify the push notification service you would like to use (Pushbullet, Pushover, or IFTTT). By default, Pushover is used. Specify "pushbullet" to use Pushbullet and "ifttt" to use IFTTT.

Examples

statapush is pretty easy to use. Just place the snippet below (with your token, user key, and message) at the point you want Stata to generate the push notification in your do file. Then run the file.

statapush, token(<INSERT API TOKEN>) userid(<INSERT USER KEY>) message(<INSERT MESSAGE>)

If you would like to use Pushbullet instead of Pushover, simply add the optional "provider(pushbullet)" argument.

statapush, token(<INSERT API TOKEN>) userid(<INSERT USER KEY>) message(<INSERT MESSAGE>) provider(pushbullet)

To use IFTTT, instead add the optional "provider(ifttt)" argument.

statapush, token(<INSERT API TOKEN>) userid(<INSERT USER KEY>) message(<INSERT MESSAGE>) provider(ifttt)

If you would like statapush to notify you when your code has finished running and if an error is detected, run your code from the statapush command by specifying your do file with the syntax below.

statapush using filename, token(<INSERT API TOKEN>) userid(<INSERT USER KEY>) message(<INSERT MESSAGE>)

If you're using Pushbullet, you can attach a file (e.g., output graph) that you'll receive with your notification.

statapush, token(<INSERT API TOKEN>) userid(<INSERT USER KEY>) message(<INSERT MESSAGE>) attachment(<INSERT FILE PATH>)

Lastly, you can set your default preferences so you do not need to include your token, user key, and push notification service preferences every time you run the command.

statapushpref, token(<INSERT API TOKEN>) userid(<INSERT USER KEY>) provider(<INSERT PROVIDER>)

statapush, message(<INSERT MESSAGE>)

Authors

William L. Schpero and Vikram Jambulapati

Contact

william.schpero@yale.edu