OpenHeart API

A Go implementation of the Open Heart Protocol.

Try it out!

Go to tylery.com

Click an emoji to send a reaction:


    
View the git repo!

Endpoints

GET https://openheart.tylery.com/example.com (200)
POST https://openheart.tylery.com/example.com (201 | 200)

Creating a Reaction

Using plain text:

# curl
curl -X POST -d "💖" https://openheart.tylery.com/example.com

# fetch
fetch('https://openheart.tylery.com/example.com', {
  method: 'POST',
  body: '💖'
})

Using form data:

# curl
curl -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "💖=" \
  'https://openheart.tylery.com/example.com'

# fetch
fetch('https://openheart.tylery.com/example.com', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  body: '💖='
})

Using JSON:

# curl
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"emoji": "💖"}' \
  'https://openheart.tylery.com/example.com'

# fetch
fetch('https://openheart.tylery.com/example.com', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ emoji: '💖' })
})

Getting Reactions

# curl
curl 'https://openheart.tylery.com/example.com'

# fetch
fetch('https://openheart.tylery.com/example.com')

# Response
{
  "💖": 5,
  "👍": 3,
  "🌟": 1
}