Giter Site home page Giter Site logo

openheart's Introduction

Open Heart Protocol

The Open Heart protocol lets an anonymous user sends an emoji reaction to a URL.

How

Set up an endpoint to receive an Open Heart POST request like this one:

curl -d '🥨' -X POST 'https://api.openheart.fyi'

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 🥨=.

<form action="https://api.openheart.fyi" method="POST" enctype="text/plain">
  <button name="🥨">🥨</button>
</form>

Server code examples

UI

It's a good idea to give visitors an easy way to send such requests; for example, with:

Count

Optionally, a GET request to the same URL may respond with the emoji reaction counts.

curl 'https://api.openheart.fyi'

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.

Questions

Why not WebMention?

This is much, much, much simpler.

What happens after POST?

The author of the endpoint decides.

What if the someone repeatedly sends emoji to my server?

It shows they may be quite enthusiastic.

What if I don't want to receive some emoji?

Create a server-side allow list or disallow list and respond with a 400.

openheart's People

Contributors

muan avatar robb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.