Hacker News new | ask | show | jobs
by miki123211 2434 days ago
If you need something like that, go for a Telegram bot. It's really simple to make, the API is very nice and developer friendly. It's not oAuth, just a simple secret. It even accepts parameters via GET, so writing a bash script that check something and sends a message via Curl is pretty easy. There are few APIs simpler than this one. This is also more efficient, as your app only sends data out when it needs to, instead of being polled every n minutes. Everything goes through a real push service, which your phone has a persistent connection to, so the messages are delivered instantly. It also saves battery life, as there's no polling. I don't think this app will ever work on iOS, due to Apple's policies.
4 comments

I created a Telegram bot for one of my apps, but had to remove Telegram from my phone/computer after their terrible handling of Facebook linking. I made the mistake of linking my Telegram account to my Facebook account, which gave me the wonderful 'feature' of getting a notification any time one of my (due to the linked account being promotional) thousands of friends joined Telegram. These notifications play at any time of the day or night, and there is no way to disable them. Removing the app was my only recourse as a chat app without notifications is pretty useless.
Turn off contact sync in Telegram and delete your uploaded contacts.
You can also turn off new contacts notifications which is something I also hated and discovered recently that you can do.
Thank!
I think the linked app is more supposed for one-off use-cases - e.g., you're a dev/admin and want to keep an eye on some web service. You could write a simple endpoint in python and have the app poll it over LAN.

I think not needing to bother with any kind of third-party is hard to beat in terms of simplicity.

> I don't think this app will ever work on iOS, due to Apple's policies.

I've not much experience on iOS, so apologies if the answer is obvious, but is there no scheduled task API you could use?

At least, you're not supposed to keep the app working in the background in Android either - however, the app's use-case should still be doable with the background scheduling API.

I don't think a simple endpoint in Python is any simpler than sending simple requests to an external API. You can do that even via Bash, Curl and Cron. Regarding iOS, using APIs improperly is one sure way to have problems with app review, see i.e. the recent Push Kit debate.
But you have an external API - meaning, you have to get a Telegram account, register a bot (and not forget to unregister it later), think about who else can see the bot, think about if it matters that Telegram can see the data, etc. If you plan to keep this up for some time, you'll also have to keep up with Telegram's policy changes, outages, etc.
Push is not always more efficient than pull. Pull puts a lower limit on traffic but it also puts an upper limit on it, plus you get an extra health check.

That's why many monitoring tools are now pull-based (Prometheus) instead of push (Graphite).

The update frequency can be set in JSON.