aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--all.json2
-rw-r--r--recipes/circuit/index.js5
-rw-r--r--recipes/circuit/package.json2
-rw-r--r--recipes/circuit/webview.js17
4 files changed, 6 insertions, 20 deletions
diff --git a/all.json b/all.json
index 368efc1..c137a30 100644
--- a/all.json
+++ b/all.json
@@ -207,7 +207,7 @@
207 "featured": false, 207 "featured": false,
208 "id": "circuit", 208 "id": "circuit",
209 "name": "Circuit", 209 "name": "Circuit",
210 "version": "1.0.1", 210 "version": "1.0.2",
211 "icons": { 211 "icons": {
212 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/circuit/icon.svg" 212 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/circuit/icon.svg"
213 } 213 }
diff --git a/recipes/circuit/index.js b/recipes/circuit/index.js
index e467459..fbbcd9a 100644
--- a/recipes/circuit/index.js
+++ b/recipes/circuit/index.js
@@ -1,5 +1,2 @@
1"use strict";
2
3// just pass through Ferdi 1// just pass through Ferdi
4 2module.exports = Ferdi => Ferdi;
5module.exports = Ferdi => Ferdi; \ No newline at end of file
diff --git a/recipes/circuit/package.json b/recipes/circuit/package.json
index 1beaa12..82eb193 100644
--- a/recipes/circuit/package.json
+++ b/recipes/circuit/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "circuit", 2 "id": "circuit",
3 "name": "Circuit", 3 "name": "Circuit",
4 "version": "1.0.1", 4 "version": "1.0.2",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://eu.yourcircuit.com/" 7 "serviceURL": "https://eu.yourcircuit.com/"
diff --git a/recipes/circuit/webview.js b/recipes/circuit/webview.js
index b5e3fd5..8cd2e2f 100644
--- a/recipes/circuit/webview.js
+++ b/recipes/circuit/webview.js
@@ -1,23 +1,12 @@
1"use strict";
2
3module.exports = Ferdi => { 1module.exports = Ferdi => {
4 const getMessages = function getMessages() { 2 const getMessages = function getMessages() {
5 // Initialize empty vars
6 var match = [];
7 // Get value of <title> tag where in case of new messages the number of messages appear 3 // Get value of <title> tag where in case of new messages the number of messages appear
8 const titleValue = document.querySelector('title').text; 4 const titleValue = document.querySelector('title').text;
9 // Extract the number from the tag 5 const match = titleValue.match(/\d+/);
10 match = titleValue.match(/\d+/); 6 const unread = match != null && match.length > 0 ? match[0] : 0;
11 unread = match != null && match.length > 0 ? match[0] : 0;
12 // Set unread msgs badge
13 7
14 Ferdi.setBadge(Ferdi.safeParseInt(unread)); 8 Ferdi.setBadge(Ferdi.safeParseInt(unread));
15 }; 9 };
16 10
17 const loopFunc = () => { 11 Ferdi.loop(getMessages);
18 getMessages();
19 };
20
21 Ferdi.loop(loopFunc);
22
23}; 12};