Live data from Hacker News

Messages via JSON

refl.me

21–30 of 129 posts

Re: Messages via JSON

#21
post #15

What's the point? Why not just forward a message to XMPP, Telegram, WhatsApp or email? You know, to the app users actually use. Why make them install one more quasi-messenger?

This would be nice for websites and services users want to get push notifications from. I get that html5 notifications should be able to do this at some point but there is still merit in having another way of getting stuff to your phone and possibly desktop.

Thing is, it does not offer push notifications. It's very opposite of that - the app seems to just poll the service with regular intervals.

Re: Messages via JSON

#23
post #6

Earlier quoted context omitted.

> The application with the required frequency directly checks JSON on the web service side How charming.

What's wrong with that?

Because it is the most inefficient approach possible. You either have potentially long delays before receiving a notification (if you poll service once an hour, average delay would be 30 minutes), or you do LOTS of polling, draining the battery/abusing the service. If you have 20 notifications / day and you check service every minute, in a day you'll make 24*60 poll requests, only 1,38% of which would yield some meaningful payload.

Re: Messages via JSON

#26
post #17
post #7

> Request signature format(crc): [time_stamp]_[md5(time_stamp+secret_key)] This should probably be an HMAC construction at the very least, and MD5 in general just should be discarded entirely in favor of BLAKE2b, SHA-2 or SHA-3. And ideally, it'd actually validate the rest of the contents as well.

Also the example PHP code doesn't validate the age of the passed timestamp so you could just replay a "signature" indefinitely... Given that, you might as well just use an unchanging token or Basic Auth. Assuming https, that wouldn't be terrible for this kind of use case. But put it in an Authorization header, not in a query parameter, so it doesn't end up in logs.

Well, the app has to support it, so you're down to the will of the developer.

Sounds like a cool little thing, but wouldn't mind a standard to use on non-mobile platforms.

Re: Messages via JSON

#27
post #10
post #6

Earlier quoted context omitted.

What's wrong with that?

Not the poster but it may be useful to know that Andrew_nenakhov is a CEO of company that provides a Jabber messanger (Xabber).

My occupation is not really relevant here, but yes, such service could be coded in maybe 60 minutes tops to accept a JSON and forward it to XMPP, and it would be way more efficient. Don't like XMPP? Ok, make a Telegram bot and receive notification with it.

Re: Messages via JSON

#29

Nice idea. Does it poll though? How do you prevent receiving the same message twice? I would have done it using server-sent events instead.

I think it does poll, and it's just looking for a diff in the previous message.
Post reply on HN