Live data from Hacker News

Messages via JSON

refl.me

41–50 of 129 posts

Re: Messages via JSON

#41
post #31

Curious, what are some examples of public json files I would "subscribe" to?

My understanding is that you would be making your own. E.g. if you had a site that people could comment on, make a url that serializes those comments as JSON and then point this at that.

As pointed out elsewhere by Andrew_nenakhov, we have that already—it's RSS. Or Atom. Or JSON Feed if you really must have JSON for some reason.

Re: Messages via JSON

#43
Awesome! I had been doing this via signal-cli, but their aren't great tools for working with Signal's API programatially and my solution was quite hacky. (I used a Google Voice number to register Signal, and parsed the output from `signal-cli --daemon` to recieve messages, and used Python's os.system to call the binary to send messages.)

Re: Messages via JSON

#44

What exactly is new in this ? Isn't this what Android and iOS notification services do ? And all messaging services ? What did I miss

It's a mobile app that polls an endpoint for json, after the user configures it (seemingly with a QR code), that's all. There's no middle-man server, and it's also not push. Neat idea, low barrier to entry. Can't tell from docs how authz/authn are handled.

And who maintains the message queue until the client pools next(the service provided by these middle-man servers) ? And what about message by user identifier ?

And client app will eat my battery because one more service is constantly polling now ?

Re: Messages via JSON

#45
It would be cool to see a directory of public JSON feeds you can subscribe to - weather notifications, sports data, transit delays, etc. You could also have premium feeds that require a subscription.

Re: Messages via JSON

#47

What exactly is new in this ? Isn't this what Android and iOS notification services do ? And all messaging services ? What did I miss

Any web service can integrate with it as long as it responds with a JSON object that adheres to the specification. It is genius.

Still didn't get the genius part,... This simply keeps polling a list of endpoint and if a new message Id comes, flashes it and stores in the list of flashed messages ? That's all right ?

Re: Messages via JSON

#48
Help me out because sometimes my reading comprehension is wonky.

So is this just polling an api that responds in JSON and then updating your phone if something in the response changes?

Re: Messages via JSON

#50
post #6

Earlier quoted context omitted.

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 mean…

And yet, this is exactly how push notifications are implemented on mobile phones. You have the illusion to push a message from server to device while in fact you also push a message onto a queue that is polled at regular intervals by the mobile. No way around it, mobile devices don't have guaranteed connectivity as servers do.
Post reply on HN