The Open Heart protocol lets an anonymous user sends an emoji reaction to a URL.
Set up an endpoint to receive an Open Heart POST
request like this one:
curl -d '🥨' -X POST 'https://api.oh.dddddddddzzzz.org/github.com/dddddddddzzzz/OpenHeart'
A Open Heart message should contain of a single emoji sequence. However, the emoji sequence may be followed by arbitrary data which the server is expected to ignore.
This allows HTML <form>
s to post reactions using the Open Heart protocol through an empty input. In this case, the payload will be 🥨=
.
Optionally, a GET
request to the same URL may respond with the emoji reaction counts.
curl 'https://api.oh.dddddddddzzzz.org/github.com/dddddddddzzzz/OpenHeart'
The response should be a JSON object mapping Emoji (as Strings) to their count (as Numbers):
{"❤️": 14,"🫀": 12,"🥨": 22}
If reaction counts are write-only, the server should respond with a 403 or a 404.
In its simplest form, you can put this on your website:
<form action="<your server endpoint>" method="POST" enctype="text/plain">
<button name="🥨">🥨</button>
</form>
However, we have also created <open-heart>
for a better user experience.
To get started quickly, you can use our public OpenHeart API, but we do recommend owning your own data whenever possible.
Here are some code example get your own endpoint running quickly:
We welcome examples using other languages and services. Please send us a pull request!
Why not WebMention
?
This is much, much, much simpler.
The author of the endpoint decides.
It shows they may be quite enthusiastic.
In all seriousness, our public API is built on Cloudflare Worker which comes with rate limiting and DDoS protection.
Create a server-side allow list or disallow list and respond with a 400.