aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/pleroma/index.js
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-05-30 00:18:13 +0200
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-05-30 21:25:23 +0530
commit1af3e44a1c4fe52706dbc79cbee7d1160cd417ab (patch)
tree4a9f5c6f348f01858c9ddb4bd88e6df532812d22 /recipes/pleroma/index.js
parentFixing unread count in telegram-react (diff)
downloadferdium-recipes-1af3e44a1c4fe52706dbc79cbee7d1160cd417ab.tar.gz
ferdium-recipes-1af3e44a1c4fe52706dbc79cbee7d1160cd417ab.tar.zst
ferdium-recipes-1af3e44a1c4fe52706dbc79cbee7d1160cd417ab.zip
Add Pleroma recipe
Pleroma is lightweight fediverse server: https://pleroma.social/
Diffstat (limited to 'recipes/pleroma/index.js')
-rw-r--r--recipes/pleroma/index.js19
1 files changed, 19 insertions, 0 deletions
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 @@
1module.exports = Ferdi => class Pleroma extends Ferdi {
2 async validateUrl(url) {
3 try {
4 const resp = await window.fetch(`${url}/api/v1/instance`, {
5 Accept: 'application/json',
6 });
7 const data = await resp.json();
8 const version = data.version;
9 return typeof (version) === 'string' && version.indexOf('Pleroma') >= 0;
10 } catch (err) {
11 console.log('Pleroma server validation error', err);
12 }
13 return false;
14 }
15
16 buildUrl(url) {
17 return `${url}/main/friends`;
18 }
19};