aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes/disqus/README.md7
-rw-r--r--recipes/disqus/icon.pngbin0 -> 15270 bytes
-rw-r--r--recipes/disqus/icon.svg57
-rw-r--r--recipes/disqus/index.js3
-rw-r--r--recipes/disqus/package.json12
-rw-r--r--recipes/disqus/webview.js24
6 files changed, 103 insertions, 0 deletions
diff --git a/recipes/disqus/README.md b/recipes/disqus/README.md
new file mode 100644
index 0000000..7b00ad9
--- /dev/null
+++ b/recipes/disqus/README.md
@@ -0,0 +1,7 @@
1# Disqus for Ferdi
2
3This is a Ferdi recipe for [Disqus](https://disqus.com/)
4
5## Release notes
6
71.0.0: First version \ No newline at end of file
diff --git a/recipes/disqus/icon.png b/recipes/disqus/icon.png
new file mode 100644
index 0000000..649823f
--- /dev/null
+++ b/recipes/disqus/icon.png
Binary files differ
diff --git a/recipes/disqus/icon.svg b/recipes/disqus/icon.svg
new file mode 100644
index 0000000..5b96298
--- /dev/null
+++ b/recipes/disqus/icon.svg
@@ -0,0 +1,57 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<svg
3 xmlns:dc="http://purl.org/dc/elements/1.1/"
4 xmlns:cc="http://creativecommons.org/ns#"
5 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6 xmlns:svg="http://www.w3.org/2000/svg"
7 xmlns="http://www.w3.org/2000/svg"
8 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10 width="2500"
11 height="2500"
12 viewBox="0 0 256 255.96217"
13 preserveAspectRatio="xMidYMid"
14 version="1.1"
15 id="svg4"
16 sodipodi:docname="icon.svg"
17 inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
18 <metadata
19 id="metadata10">
20 <rdf:RDF>
21 <cc:Work
22 rdf:about="">
23 <dc:format>image/svg+xml</dc:format>
24 <dc:type
25 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
26 <dc:title />
27 </cc:Work>
28 </rdf:RDF>
29 </metadata>
30 <defs
31 id="defs8" />
32 <sodipodi:namedview
33 pagecolor="#ffffff"
34 bordercolor="#666666"
35 borderopacity="1"
36 objecttolerance="10"
37 gridtolerance="10"
38 guidetolerance="10"
39 inkscape:pageopacity="0"
40 inkscape:pageshadow="2"
41 inkscape:window-width="1671"
42 inkscape:window-height="980"
43 id="namedview6"
44 showgrid="false"
45 inkscape:zoom="0.27074767"
46 inkscape:cx="482.16403"
47 inkscape:cy="1216"
48 inkscape:window-x="2641"
49 inkscape:window-y="199"
50 inkscape:window-maximized="0"
51 inkscape:current-layer="svg4"
52 inkscape:document-rotation="0" />
53 <path
54 d="m 132.669,252.29758 c -30.422,0 -58.237,-11.117 -79.743,-29.506 l -52.926,7.23 20.447,-50.465 c -7.124,-15.719 -11.12,-33.17 -11.12,-51.575 0,-68.653995 55.222,-124.316995 123.342,-124.316995 68.114,0 123.331,55.663 123.331,124.316995 0,68.666 -55.215,124.316 -123.331,124.316 z m 67.346,-124.672 v -0.346 c 0,-35.872995 -25.298,-61.452995 -68.917,-61.452995 H 83.986 V 190.14358 H 130.4 c 43.958,0.001 69.615,-26.647 69.615,-62.518 z m -68.398,31.974 h -13.78 V 96.379585 h 13.78 c 20.239,0 33.672,11.537995 33.672,31.437995 v 0.346 c 0,20.067 -13.433,31.436 -33.672,31.436 z"
55 fill="#2e9fff"
56 id="path2" />
57</svg>
diff --git a/recipes/disqus/index.js b/recipes/disqus/index.js
new file mode 100644
index 0000000..cd5b37c
--- /dev/null
+++ b/recipes/disqus/index.js
@@ -0,0 +1,3 @@
1"use strict";
2
3module.exports = Ferdi => Ferdi;
diff --git a/recipes/disqus/package.json b/recipes/disqus/package.json
new file mode 100644
index 0000000..fb723e6
--- /dev/null
+++ b/recipes/disqus/package.json
@@ -0,0 +1,12 @@
1{
2 "id": "disqus",
3 "name": "Disqus",
4 "version": "1.0.0",
5 "description": "disqus",
6 "main": "index.js",
7 "author": "Ferdi <hello@getferdi.com>",
8 "license": "MIT",
9 "config": {
10 "serviceURL": "https://disqus.com/home/"
11 }
12} \ No newline at end of file
diff --git a/recipes/disqus/webview.js b/recipes/disqus/webview.js
new file mode 100644
index 0000000..797db5f
--- /dev/null
+++ b/recipes/disqus/webview.js
@@ -0,0 +1,24 @@
1"use strict";
2
3var _path = _interopRequireDefault(require("path"));
4
5function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
7let getInnerInt = selector => {
8 const element = document.querySelector(selector);
9 return element && parseInt(element.innerText);
10}
11
12module.exports = Ferdi => {
13 const getMessages = function getMessages() {
14 let direct = (
15 getInnerInt("header div[data-role='unread-notification-count']") ||
16 getInnerInt("a.has-notifs div.notif-count") ||
17 0
18 );
19
20 Ferdi.setBadge(direct);
21 };
22
23 Ferdi.loop(getMessages);
24};