Hi everyone,
In the spirit of the Easter long weekend, I’m releasing a new package that might help some of you spend less time at your desk and more time hunting for eggs (or just enjoying a coffee/wine in peace).
The package is called telegram. It’s a no-nonsense tool to send free push notifications (mobile alerts) and exported Stata figures directly to your smartphone or desktop via the Telegram messenger API.
Why use this? We’ve all had those long-running Monte Carlo simulations, bootstraps, or server batch jobs that leave us tethered to the office. While Stata can send emails via mail, configuring SMTP servers is often a headache—especially on restricted networks. telegram uses the OS-native curl command to bypass those hurdles entirely.
Key Technical Features:
Setup: If you have the Telegram App on your phone (iPhone or Android), the package will guide you through setting up the API. It's as simple as running:
Quick Example:
I've tested this on Windows and macOS using Stata 19.5. It should theoretically run on any version from 17 onwards due to the Unicode requirements, but I’d welcome feedback from anyone running earlier versions.
Best,
Daniel Obst [https://github.com/DObst/stata-telegram]
In the spirit of the Easter long weekend, I’m releasing a new package that might help some of you spend less time at your desk and more time hunting for eggs (or just enjoying a coffee/wine in peace).
The package is called telegram. It’s a no-nonsense tool to send free push notifications (mobile alerts) and exported Stata figures directly to your smartphone or desktop via the Telegram messenger API.
Why use this? We’ve all had those long-running Monte Carlo simulations, bootstraps, or server batch jobs that leave us tethered to the office. While Stata can send emails via mail, configuring SMTP servers is often a headache—especially on restricted networks. telegram uses the OS-native curl command to bypass those hurdles entirely.
Key Technical Features:
- Interactive Setup: Running telegram setup once stores your Bot Token and Chat ID in your PERSONAL directory (VDI users: remember to point your sysdir to a persistent drive).
- Graph Support: Pushes .png or .jpg exports directly to your device so you can review results remotely.
- Unicode & Chunking: Fully Unicode-aware; it automatically splits messages exceeding 4,000 characters to ensure complex characters/emojis don't break the API boundary.
- Shortcuts: Includes a tg alias for quick status updates in your do-files.
Code:
net install telegram, from("https://raw.githubusercontent.com/DO...telegram/main/")
Code:
telegram setup
Code:
sysuse auto, clear
scatter price mpg
graph export "results.png", as(png) replace
tg "Model finished. R-squared is 0.85. || Let's pretend that's causal...", figure("results.png")
Best,
Daniel Obst [https://github.com/DObst/stata-telegram]
