From 02b108d4a6c684034b003b94d0979fee03f6b31a Mon Sep 17 00:00:00 2001 From: Simon Szustkowski Date: Wed, 24 Nov 2021 13:05:44 +0100 Subject: Added recipe for Circuit (#771) --- all.json | 9 +++++++++ recipes/circuit/README.md | 3 +++ recipes/circuit/icon.svg | 1 + recipes/circuit/index.js | 5 +++++ recipes/circuit/package.json | 9 +++++++++ recipes/circuit/webview.js | 22 ++++++++++++++++++++++ 6 files changed, 49 insertions(+) create mode 100644 recipes/circuit/README.md create mode 100644 recipes/circuit/icon.svg create mode 100644 recipes/circuit/index.js create mode 100644 recipes/circuit/package.json create mode 100644 recipes/circuit/webview.js diff --git a/all.json b/all.json index 85e2da6..02a5d7a 100644 --- a/all.json +++ b/all.json @@ -203,6 +203,15 @@ "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/chatwork/icon.svg" } }, + { + "featured": false, + "id": "circuit", + "name": "Circuit", + "version": "1.0.0", + "icons": { + "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/circuit/icon.svg" + } + }, { "featured": false, "id": "ciscospark", diff --git a/recipes/circuit/README.md b/recipes/circuit/README.md new file mode 100644 index 0000000..317c0fd --- /dev/null +++ b/recipes/circuit/README.md @@ -0,0 +1,3 @@ +# Circuit EU for Ferdi + +Unofficial Ferdi recipe for [Circuit by Atos Unify](https://eu.yourcircuit.com/) \ No newline at end of file diff --git a/recipes/circuit/icon.svg b/recipes/circuit/icon.svg new file mode 100644 index 0000000..6bbb4ba --- /dev/null +++ b/recipes/circuit/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/circuit/index.js b/recipes/circuit/index.js new file mode 100644 index 0000000..e467459 --- /dev/null +++ b/recipes/circuit/index.js @@ -0,0 +1,5 @@ +"use strict"; + +// just pass through Ferdi + +module.exports = Ferdi => Ferdi; \ No newline at end of file diff --git a/recipes/circuit/package.json b/recipes/circuit/package.json new file mode 100644 index 0000000..a569472 --- /dev/null +++ b/recipes/circuit/package.json @@ -0,0 +1,9 @@ +{ + "id": "circuit", + "name": "Circuit", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://eu.yourcircuit.com/" + } +} diff --git a/recipes/circuit/webview.js b/recipes/circuit/webview.js new file mode 100644 index 0000000..ab1175f --- /dev/null +++ b/recipes/circuit/webview.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = Ferdi => { + const getMessages = function getMessages() { + // Initialize empty vars + var unread = 0; + var match = []; + // Get value of tag where in case of new messages the number of messages appear + const titleValue = document.querySelector('title').text; + // Extract the number from the tag + match = titleValue.match(/\d+/); + // Set unread msgs badge + Ferdi.setBadge(Ferdi.safeParseInt(match[0])); + }; + + const loopFunc = () => { + getMessages(); + }; + + Ferdi.loop(loopFunc); + +}; -- cgit v1.2.3-70-g09d2