diff --git a/assets/scripts.js b/assets/scripts.js index 4a5918d..45ed3e0 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -413,6 +413,29 @@ async function verifyProof(url, fingerprint) { return output; } } + // Lobsters + if (/^https:\/\/lobste.rs/.test(url)) { + output.type = "lobsters"; + match = url.match(/https:\/\/lobste.rs\/u\/(.*)/); + output.display = match[1]; + output.proofUrlFetch = `/server/verifyLobsters.php?user=${match[1]}&fp=${fingerprint}`; + try { + response = await fetch(output.proofUrlFetch, { + headers: { + Accept: 'application/json' + }, + credentials: 'omit' + }); + if (!response.ok) { + throw new Error('Response failed: ' + response.status); + } + json = await response.json(); + output.isVerified = json.verified; + } catch (e) { + } finally { + return output; + } + } // XMPP if (/^xmpp:/.test(url)) { output.type = "xmpp"; diff --git a/server/verifyLobsters.php b/server/verifyLobsters.php new file mode 100644 index 0000000..96f1212 --- /dev/null +++ b/server/verifyLobsters.php @@ -0,0 +1,29 @@ +