From 1af3e44a1c4fe52706dbc79cbee7d1160cd417ab Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sun, 30 May 2021 00:18:13 +0200 Subject: Add Pleroma recipe Pleroma is lightweight fediverse server: https://pleroma.social/ --- recipes/pleroma/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 recipes/pleroma/index.js (limited to 'recipes/pleroma/index.js') diff --git a/recipes/pleroma/index.js b/recipes/pleroma/index.js new file mode 100644 index 0000000..c6cf368 --- /dev/null +++ b/recipes/pleroma/index.js @@ -0,0 +1,19 @@ +module.exports = Ferdi => class Pleroma extends Ferdi { + async validateUrl(url) { + try { + const resp = await window.fetch(`${url}/api/v1/instance`, { + Accept: 'application/json', + }); + const data = await resp.json(); + const version = data.version; + return typeof (version) === 'string' && version.indexOf('Pleroma') >= 0; + } catch (err) { + console.log('Pleroma server validation error', err); + } + return false; + } + + buildUrl(url) { + return `${url}/main/friends`; + } +}; -- cgit v1.2.3-70-g09d2