From 054fb8b5e82bf4387ecafb6df1dca5222582e6a6 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sun, 12 Sep 2021 18:12:00 +0530 Subject: New recipe: 'sococo' (#704) --- all.json | 9 ++++ recipes/sococo/icon.svg | 128 ++++++++++++++++++++++++++++++++++++++++++++ recipes/sococo/index.js | 1 + recipes/sococo/package.json | 11 ++++ recipes/sococo/webview.js | 12 +++++ 5 files changed, 161 insertions(+) create mode 100644 recipes/sococo/icon.svg create mode 100644 recipes/sococo/index.js create mode 100644 recipes/sococo/package.json create mode 100644 recipes/sococo/webview.js diff --git a/all.json b/all.json index 418e204..8620a78 100644 --- a/all.json +++ b/all.json @@ -1427,6 +1427,15 @@ "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/snapdrop/icon.svg" } }, + { + "featured": false, + "id": "sococo", + "name": "Sococo", + "version": "1.0.0", + "icons": { + "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/sococo/icon.svg" + } + }, { "featured": false, "id": "stackexchange", diff --git a/recipes/sococo/icon.svg b/recipes/sococo/icon.svg new file mode 100644 index 0000000..e19e85b --- /dev/null +++ b/recipes/sococo/icon.svg @@ -0,0 +1,128 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + + + diff --git a/recipes/sococo/index.js b/recipes/sococo/index.js new file mode 100644 index 0000000..23607bd --- /dev/null +++ b/recipes/sococo/index.js @@ -0,0 +1 @@ +module.exports = Ferdi => Ferdi; diff --git a/recipes/sococo/package.json b/recipes/sococo/package.json new file mode 100644 index 0000000..f68b52d --- /dev/null +++ b/recipes/sococo/package.json @@ -0,0 +1,11 @@ +{ + "id": "sococo", + "name": "Sococo", + "version": "1.0.0", + "license": "MIT", + "repository": "https://github.com/klcodanr/recipe-sococo", + "config": { + "serviceURL": "https://app.sococo.com", + "hasNotificationSound": true + } +} diff --git a/recipes/sococo/webview.js b/recipes/sococo/webview.js new file mode 100644 index 0000000..14561cd --- /dev/null +++ b/recipes/sococo/webview.js @@ -0,0 +1,12 @@ +module.exports = (Ferdi) => { + const getMessages = function getMessages() { + let indirect = document.querySelectorAll('.new-messages'); + let direct = 0; + document.querySelectorAll('.people-pane .badge').forEach(function(badge){ + direct += Ferdi.safeParseInt(badge.innerText); + }); + Ferdi.setBadge(direct, indirect); + }; + + Ferdi.loop(getMessages); +}; -- cgit v1.2.3-70-g09d2