
Messages via JSON - teko_ji
https://refl.me
======
miki123211
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.

~~~
NickBusey
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.

~~~
orasis
Turn off contact sync in Telegram and delete your uploaded contacts.

~~~
tngranados
You can also turn off new contacts notifications which is something I also
hated and discovered recently that you can do.

------
beefhash
> 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.

~~~
enedil
There's another problem, if the author tells us that this is crc, while it's a
MAC (not particularly strong tbh), it shows that we, as developers and users,
cannot trust that cryptographic decisions of the author are of any
consideration. For reference, crc is not a signature, its full name is "cyclic
redundancy check", which is a really simple mathematical operation, that
computes a specific remainder that comes from polynomial long division (of
polynomials decided from the message). It is not any kind of cryptographic
signature and given a string, it's crc and target crc, we can find another
string that differs in one byte only, that has the target crc, all of this in
time faster than computing whole original crc.

~~~
ozzmotik
>we can find another string that differs in one byte only, that has the target
crc

reading that has me curious; if one can do that for any arbitrary string, and
then iterate that process, doesn't that stand to reason that with enough work,
one could make any two given strings calculate out to the same crc? I guess
maybe not because that one byte constraint isn't specified as far as where it
occurs and whether it's an insertion, deletion, permutation etc, but the way I
see it if you can do it with one string to another, you could likely keep
chaining that indefinitely and get countless strings that come to the same
crc.

sorry if this is old news or anything I was just struck by that thought while
reading your comment

~~~
dfox
The amount of bits you need to modify is not “one byte” but the same as the
degree of used polynomial.

And producing two strings with same CRC is trivial to the extent that it is
how you are originally supposed to use the algorithm. Notice that CRC-32 of
every valid ISO9660 filesystem is 0xffffffff ;)

~~~
enedil
Yes, sorry for the lack of scrupulosity. Of course, it might happen it
suffices to change one byte, especially that this byte can be at any position.

------
Andrew_nenakhov
Oh, I finally understand it! It is just an RSS (but with JSON instead of XML)!

~~~
mc3
I think this is more focused than RSS. Doing the same with an RSS reader would
be fiddly and sort of out of it's use case. If you want regular polling (every
15s say) maybe your RSS reader can do that but it isn't natural.

There is something to be said for things being similar but not the same. This
app can grow features in the direction of alerting, whereas an RSS reader
wouldn't be growing in that direction without becoming bloatware because it's
main job is to catch you up on reading material.

I can see myself using it, and it has been something I have consider building
myself - although I had a different angle - an API for a person so you can
send me a message (if I trust you... maybe I give each friend a different
token!) and we can avoid using email or a proprietary chat alltogether. Such a
service could work in tandem with this app.

Based on that you could make a distributed "facebook" of sorts.

Once the iPhone app of this come out I can see myself setting up a little
nodejs server and aggregating some stuff to send down. Weather, email, SMS,
maybe some favourite google searches (when they change) or hn.algolia.com
searches.

~~~
Andrew_nenakhov
Thing is, you don't want regular polling every 15s! It's 5760 requests per
day! For EVERY SOURCE! Trust me, your device battery won't like it. Won't like
it at all.

> although I had a different angle - an API for a person so you can send me a
> message ... and we can avoid using email or a proprietary chat alltogether

If you want to exchange messages avoiding email or proprietary chats, you have
a wide variety of open chat protocols and free and open source chat
applications to choose from. XMPP, Matrix, IRC, mastodon, rocketchat,
mattermost, ... dozens of them!

------
slugiscool99
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.

~~~
tomcooks
Like RSS, but better

There is a nice substratum of curl services, like wttr.in or getnews.tech that
follow a similar concept

I hope this is the beginning of a gopher + JSON + curl services era

------
poyu
What's the difference between this and
[Pushover]([https://pushover.net](https://pushover.net))?

~~~
noahster11
Pushover also handles a server, which you can make requests to, that sends
push notifications to your phone. It looks like this project just scrapes JSON
from a URL for changes, and notifies from that.

Pushover is push based, while this looks to be pull based.

------
firefoxd
I think this is a simple and neat tool. Thank you for building it, and
congratulations for launching.

~~~
re_dmitriy
Thanks!

------
bradhe
Damn this is _such_ a good idea. Great job team.

~~~
MuffinFlavored
I agree, just a weird name. Why REFL?

~~~
greyskull
> short for "reflection"

[https://medium.com/@re_dmitriy/what-is-refl-
me-67e6eb151f27](https://medium.com/@re_dmitriy/what-is-refl-me-67e6eb151f27)

~~~
MuffinFlavored
i do not think “reflection” when i think “text me JSON events”

~~~
greyskull
FWIW I agree.

------
Andrew_nenakhov
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?

~~~
teko_ji
Because they don't work directly with web services. Read the author's article:
[https://medium.com/@re_dmitriy/what-is-refl-
me-67e6eb151f27](https://medium.com/@re_dmitriy/what-is-refl-me-67e6eb151f27)

~~~
Andrew_nenakhov
> The application with the required frequency directly checks JSON on the web
> service side

How charming.

~~~
teko_ji
What's wrong with that?

~~~
Andrew_nenakhov
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.

~~~
nicolas314
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.

~~~
Andrew_nenakhov
No. That's not how it works.

From the Apple Developers Documentation [1], "On initial launch of your app on
a user’s device, the system automatically establishes an accredited,
encrypted, and persistent IP connection between your app and APNs."

This persistent connection is, in fact, an XMPP session (likely, a modified
one) [2].

Google's FCM too uses XMPP [3].

[1]
[https://developer.apple.com/library/archive/documentation/Ne...](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html)

[2] [https://www.quora.com/What-technology-does-the-iOS-Apple-
Pus...](https://www.quora.com/What-technology-does-the-iOS-Apple-Push-
Notification-Service-APNS-use-to-maintain-a-persistent-connection-with-each-
device-to-receive-such-fast-push-notifications)

[3] [https://firebase.google.com/docs/cloud-messaging/xmpp-
server...](https://firebase.google.com/docs/cloud-messaging/xmpp-server-ref)

~~~
icedchai
If you look at the format of APNS messages, they are _nothing_ like XMPP. It
seems very unlikely Apple uses it. That link you post does not confirm it.

~~~
Andrew_nenakhov
Format of APNS messages is just a payload. The information about APNS being
based on XMPP was widely available on developer.apple.com and was often
mentioned in developer sessions in 2010..12 when I was actively following it.

The current absence of direct XMPP mentions on Apple Deveoper website might
mean that they consider their internal technology not important for
developers, or it _might_ mean that Apple had changed the protocol for some
reason (they could have opted to use some binary protocol, for example), but
claiming that push notifications work on iOS devices by polling servers is
beyond ridiculous. VoIP pushes arrive in ~1 second. Such response times would
require 40000 poll requests/day or _more_

~~~
icedchai
I never claimed APNS worked by polling. I was developing iOS apps in the
2010-2012 time frame and never saw a mention of XMPP. I simply don't believe
they are using it. They must have their own proprietary solution.

~~~
Andrew_nenakhov
> I never claimed APNS worked by polling.

I was referring to earlier comments by nicolas314, sorry if it wasn't clear.

> I was developing iOS apps in the 2010-2012 time frame and never saw a
> mention of XMPP

I might have been more attentive to these details because XMPP was relevant
for my projects. Anyway, Apple definitely does use port 5223 [1][2] for push
notifications. What protocol is known to use this port?

Speaking of proprietary, it is very likely that they have modified it (by
stripping it down, mostly). Many XMPP features are excessive or inefficent for
push notifications, but core functions - message routing and persistent TCP
connection are extremely well suited for serving several billion devices.

[1] [https://support.apple.com/en-us/HT203609](https://support.apple.com/en-
us/HT203609)

[2] [https://support.apple.com/en-us/HT210060](https://support.apple.com/en-
us/HT210060)

------
somebodythere
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.)

------
DevKoala
Amazing idea. For my job, I have all sorts of instrumentations on my web
services for monitoring sake. However, I have none for my pet projects, and
this is just the right amount of monitoring I need. Now, I can wait for the
iOS version or perhaps just roll my own app; It is a very neat idea, which I
can see helping me in tons of scenarios.

------
duxup
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?

------
IshKebab
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.

~~~
fredifrum
I think it does poll, and it's just looking for a diff in the previous
message.

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

~~~
SamBam
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.

~~~
shantly
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_dmitriy
There's no simplicity. REFL.ME is easier. Try it.

------
sixplusone

      $json_array = array('reflapp'=>true,'message'=>'test');
    

shouldn't that be

    
    
      $json_array = array('refl.me'=>true,'message'=>'test');

~~~
teko_ji
It's already been fixed. Thank you.

------
jrockway
I think this is basically Slack webhooks without Slack. Not a bad idea,
actually.

------
purple_ducks
> The "refl.me" key must always be true, otherwise an error will be called.

Why?

~~~
ValueNull
Wish this wasn’t the case, would love to integrate services I don’t control
into this.

~~~
joshstrange
I won't pretend it's "so easy" or anything like that but could you just proxy
those requests and add the key yourself? AWS Lambda comes to mind as a
cheap/free way to accomplish this with the benefit of letting you modify the
data if needed on the fly (or even check against a DynamoDB for history/other
rules).

~~~
ValueNull
Wouldn’t this defeat one of the benefits of this software, the need to not
host your own server (or any backend infrastructure)?

~~~
joshstrange
I think the value-add with this service is the notification sending just by
exposing an endpoint. I don't see any mention of not needing backend
infrastructure (they even call out "connect your web service").

I think this is aimed at people who already are or can expose data via an HTTP
endpoint and want notifications when that changes/updates. This includes the
wide array of software developers who work on large OS projects that support
sending notifications via services like PushBullet/Pushover/etc. Also,
presumably, web services would just add a new endpoint with some auth token to
easily send push notifications to their users without managing an app and
everything else needed (push tokens, certs, GCM/FCM, apns, it can be a
headache, trust me).

Personally I see pushover-type services (I use pushover so I'm only speaking
from that experience) as more useful since I can "push" out of my networks
much easier than a service can "poll" me. That said pushover has always been a
little clunky IMHO with trying to get a service to send me notifications. So a
simple "Paste this url into the refl.me app to get notifications from us" is a
pretty attractive alternative for certain use cases.

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

~~~
greyskull
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.

~~~
codegladiator
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 ?

~~~
screaminghawk
You can configure the refresh interval in the service response:
[https://refl.me/docs](https://refl.me/docs)

Would be nice if you could override this client side as well.

------
ActorNightly
Im not getting notifications with the test_crc endpoint. Key is correct, Pixel
2 Android 10 latest version.

------
wolco
Why isn't my device compatible with this version? What versions are they
targeting?

~~~
sixplusone
Also, this could be just a html page with a few lines of
XMLHttpRequest/WebSocket code no?

------
Krasnol
Is this thing russian just for me? Couldn't find a way to change the language.

~~~
ignoranceprior
Click the "RU" link in the top corner, then click "English".

Or just go here: [https://refl.me/?lang=en](https://refl.me/?lang=en)

~~~
Krasnol
No, I mean the app itself.

~~~
re_dmitriy
Update the app. Error corrected.

~~~
Krasnol
Thank you! :)

------
joan453
Simple and interesting idea!

~~~
re_dmitriy
Thank!

