jb55 on Nostr: Damus translation service requests are authenticated by nostr notes. This is a simple ...
Damus translation service requests are authenticated by nostr notes. This is a simple way to make authenticated requests, no api keys needed.
$ curl -d @<(nostril --sec $jb55sec --content '{"source":"JA","target":"EN","q":"こんにちはwill"}')
https://api.damus.io/translate{"text":"Hi will"}
It also caches translation results: translation_id = sha2(q+source+target)
So they can be looked up again without calling deepl.
This is all open source as well if you want to make your own caching deepl translator:
https://github.com/damus-io/apiPublished at
2023-11-25 19:35:20Event JSON
{
"id": "60e865ed04f8d7eb4915be79941657220c2324dcda19d34d71ac6f9c7fc376a0",
"pubkey": "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245",
"created_at": 1700940920,
"kind": 1,
"tags": [
[
"r",
"https://api.damus.io/translate"
],
[
"r",
"https://github.com/damus-io/api"
]
],
"content": "Damus translation service requests are authenticated by nostr notes. This is a simple way to make authenticated requests, no api keys needed.\n\n$ curl -d @\u003c(nostril --sec $jb55sec --content '{\"source\":\"JA\",\"target\":\"EN\",\"q\":\"こんにちはwill\"}') https://api.damus.io/translate\n\n{\"text\":\"Hi will\"}\n\nIt also caches translation results: translation_id = sha2(q+source+target)\n\nSo they can be looked up again without calling deepl.\n\nThis is all open source as well if you want to make your own caching deepl translator:\n\nhttps://github.com/damus-io/api",
"sig": "3ff66ca97953eae31b53e51e4eba6c31ddb351feefc2c5346aeef2375bdc61bd201a223543f2328309e5f507ec8be9287889419fc1d86226c2205518b11c3131"
}