{"id":13621998,"url":"https://github.com/dddddddddzzzz/OpenHeart","last_synced_at":"2025-04-15T05:33:02.790Z","repository":{"id":56766201,"uuid":"524689665","full_name":"dddddddddzzzz/OpenHeart","owner":"dddddddddzzzz","description":"The Open Heart protocol.","archived":false,"fork":false,"pushed_at":"2022-08-21T12:07:59.000Z","size":18,"stargazers_count":62,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-01T21:50:07.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://openheart.fyi","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dddddddddzzzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-14T14:09:56.000Z","updated_at":"2024-07-09T11:26:32.000Z","dependencies_parsed_at":"2022-08-16T02:20:10.032Z","dependency_job_id":null,"html_url":"https://github.com/dddddddddzzzz/OpenHeart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2FOpenHeart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2FOpenHeart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2FOpenHeart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2FOpenHeart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dddddddddzzzz","download_url":"https://codeload.github.com/dddddddddzzzz/OpenHeart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223661279,"owners_count":17181642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:12.780Z","updated_at":"2024-11-08T09:30:38.120Z","avatar_url":"https://github.com/dddddddddzzzz.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# Open Heart Protocol\n\nThe Open Heart protocol lets an anonymous user sends an emoji reaction to a URL.\n\n## How\n\nSet up an endpoint to receive an Open Heart `POST` request like this one:\n\n```bash\ncurl -d '🥨' -X POST 'https://api.oh.dddddddddzzzz.org/github.com/dddddddddzzzz/OpenHeart'\n```\n\nA 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. \n\nThis allows HTML `\u003cform\u003e`s to post reactions using the Open Heart protocol through an empty input. In this case, the payload will be `🥨=`.\n\n---\n\nOptionally, a `GET` request to the same URL may respond with the emoji reaction counts.\n\n```bash\ncurl 'https://api.oh.dddddddddzzzz.org/github.com/dddddddddzzzz/OpenHeart'\n```\n\nThe response should be a JSON object mapping Emoji (as Strings) to their count (as Numbers):\n\n```json\n{\"❤️\": 14,\"🫀\": 12,\"🥨\": 22}\n```\n\nIf reaction counts are write-only, the server should respond with a [403](https://http.cat/403) or a [404](https://http.cat/404).\n\n## Usage\n\nIn its simplest form, you can put this on your website:\n```html\n\u003cform action=\"\u003cyour server endpoint\u003e\" method=\"POST\" enctype=\"text/plain\"\u003e\n  \u003cbutton name=\"🥨\"\u003e🥨\u003c/button\u003e\n\u003c/form\u003e\n```\n\nHowever, we have also created [`\u003copen-heart\u003e`](https://github.com/dddddddddzzzz/open-heart-element) for a better user experience.\n\n## Server code\n\nTo get started quickly, you can use our [public OpenHeart API](https://github.com/dddddddddzzzz/api-oh?tab=readme-ov-file#put-it-on-your-website-right-now), but we do recommend owning your own data whenever possible.\n\nHere are some code example get your own endpoint running quickly:\n\n- [With Cloudflare Worker \u0026 Cloudflare KV](https://gist.github.com/muan/388430d0ed03c55662e72bb98ff28f03)\n- [With Glitch and `fasify`](https://glitch.com/edit/#!/open-heart-server-demo)\n\nWe welcome examples using other languages and services. Please send us a pull request!\n\n## Questions\n\n### Why not [`WebMention`](https://www.w3.org/TR/webmention/#sending-webmentions)?\n\nThis is much, much, much simpler.\n\n### What happens after POST?\n\nThe author of the endpoint decides.\n\n### What if the someone repeatedly sends emoji to my server?\n\nIt shows they may be quite enthusiastic. \n\nIn all seriousness, our [public API](https://github.com/dddddddddzzzz/api-oh) is built on [Cloudflare Worker](https://workers.cloudflare.com) which comes with rate limiting and DDoS protection.\n\n### What if I don't want to receive some emoji?\n\nCreate a server-side allow list or disallow list and respond with a [400](https://http.cat/400).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdddddddddzzzz%2FOpenHeart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdddddddddzzzz%2FOpenHeart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdddddddddzzzz%2FOpenHeart/lists"}