aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/hey
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-12 17:38:08 +0530
committerLibravatar GitHub <noreply@github.com>2021-09-12 12:08:08 +0000
commit2ce7cb8f6dfc20a634ac639fc08fc3bc3048c79b (patch)
tree7cdb72095d6df2d3c0f584da2e7925e41cc961e0 /recipes/hey
parentNew recipe: 'freshdesk' (#700) (diff)
downloadferdium-recipes-2ce7cb8f6dfc20a634ac639fc08fc3bc3048c79b.tar.gz
ferdium-recipes-2ce7cb8f6dfc20a634ac639fc08fc3bc3048c79b.tar.zst
ferdium-recipes-2ce7cb8f6dfc20a634ac639fc08fc3bc3048c79b.zip
New recipe: 'hey' (#701)
Diffstat (limited to 'recipes/hey')
-rw-r--r--recipes/hey/LICENSE21
-rw-r--r--recipes/hey/icon.svg71
-rw-r--r--recipes/hey/index.js1
-rw-r--r--recipes/hey/package.json10
-rw-r--r--recipes/hey/webview.js28
5 files changed, 131 insertions, 0 deletions
diff --git a/recipes/hey/LICENSE b/recipes/hey/LICENSE
new file mode 100644
index 0000000..1836cd1
--- /dev/null
+++ b/recipes/hey/LICENSE
@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) 2020 Chris Wood
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all
13copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21SOFTWARE.
diff --git a/recipes/hey/icon.svg b/recipes/hey/icon.svg
new file mode 100644
index 0000000..376f7d0
--- /dev/null
+++ b/recipes/hey/icon.svg
@@ -0,0 +1,71 @@
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 inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
11 sodipodi:docname="icon.svg"
12 id="svg32"
13 preserveAspectRatio="xMidYMid meet"
14 viewBox="0 0 246.000000 246.000000"
15 height="246.000000pt"
16 width="246.000000pt"
17 version="1.0">
18 <defs
19 id="defs36" />
20 <sodipodi:namedview
21 inkscape:current-layer="svg32"
22 inkscape:window-maximized="1"
23 inkscape:window-y="-11"
24 inkscape:window-x="-11"
25 inkscape:cy="163.20043"
26 inkscape:cx="164"
27 inkscape:zoom="5.6280488"
28 showgrid="false"
29 id="namedview34"
30 inkscape:window-height="2066"
31 inkscape:window-width="3840"
32 inkscape:pageshadow="2"
33 inkscape:pageopacity="0"
34 guidetolerance="10"
35 gridtolerance="10"
36 objecttolerance="10"
37 borderopacity="1"
38 bordercolor="#666666"
39 pagecolor="#ffffff" />
40 <metadata
41 id="metadata24">
42Created by potrace 1.16, written by Peter Selinger 2001-2019
43<rdf:RDF>
44 <cc:Work
45 rdf:about="">
46 <dc:format>image/svg+xml</dc:format>
47 <dc:type
48 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
49 </cc:Work>
50</rdf:RDF>
51</metadata>
52 <rect
53 y="18.256771"
54 x="11.9935"
55 height="206.28821"
56 width="218.81474"
57 id="rect38"
58 style="fill:#ffffff;fill-rule:evenodd;stroke-width:0.75" />
59 <g
60 id="g30"
61 stroke="none"
62 fill="#4633EA"
63 transform="translate(0.000000,246.000000) scale(0.100000,-0.100000)">
64 <path
65 id="path26"
66 d="M0 1230 l0 -1230 1230 0 1230 0 0 1230 0 1230 -1230 0 -1230 0 0 -1230z m1388 876 c22 -23 56 -77 75 -118 46 -97 110 -289 133 -398 10 -47 19 -86 20 -88 1 -2 24 13 51 34 161 124 318 96 363 -65 28 -99 1 -296 -69 -509 -55 -167 -140 -369 -158 -376 -22 -9 -50 2 -57 21 -4 8 23 88 59 177 138 345 183 591 129 698 -39 76 -141 59 -245 -41 l-52 -50 7 -78 c27 -284 23 -456 -12 -536 -28 -63 -73 -97 -128 -97 -81 0 -122 74 -109 194 10 83 55 256 105 401 49 139 49 154 0 345 -46 182 -132 394 -174 429 -13 11 -18 8 -35 -20 -33 -54 -51 -157 -51 -291 0 -148 11 -244 51 -442 30 -151 30 -179 3 -190 -33 -13 -52 14 -89 126 -74 224 -148 416 -212 547 -79 164 -89 163 -87 -7 2 -159 37 -324 126 -589 76 -227 77 -243 22 -243 -21 0 -35 22 -109 171 -133 265 -249 469 -267 469 -14 0 -8 -108 11 -208 24 -123 63 -240 135 -408 31 -70 56 -136 56 -146 0 -21 -35 -42 -54 -31 -8 4 -47 57 -87 117 -41 61 -105 142 -143 180 l-70 71 -4 -38 c-5 -57 33 -191 84 -296 128 -267 310 -410 519 -411 62 0 85 -11 85 -41 0 -32 -29 -43 -104 -42 -223 5 -431 162 -564 428 -77 152 -120 321 -102 400 22 96 99 103 192 17 l27 -25 -19 64 c-32 103 -50 215 -50 304 0 120 22 165 82 165 39 0 87 -49 142 -143 21 -37 40 -66 41 -65 2 2 -4 32 -11 68 -22 95 -29 305 -14 368 16 69 43 102 82 102 57 0 111 -76 203 -287 l32 -72 6 127 c9 179 36 272 100 340 46 47 83 44 135 -12z" />
67 <path
68 id="path28"
69 d="M1538 1115 c-53 -175 -71 -309 -48 -345 13 -21 40 -3 63 43 22 44 33 235 20 332 l-8 60 -27 -90z" />
70 </g>
71</svg>
diff --git a/recipes/hey/index.js b/recipes/hey/index.js
new file mode 100644
index 0000000..23607bd
--- /dev/null
+++ b/recipes/hey/index.js
@@ -0,0 +1 @@
module.exports = Ferdi => Ferdi;
diff --git a/recipes/hey/package.json b/recipes/hey/package.json
new file mode 100644
index 0000000..02b1334
--- /dev/null
+++ b/recipes/hey/package.json
@@ -0,0 +1,10 @@
1{
2 "id": "hey",
3 "name": "Hey",
4 "version": "1.0.0",
5 "repository": "https://github.com/cpwood/recipe-hey",
6 "config": {
7 "serviceURL": "https://app.hey.com",
8 "hasIndirectMessages": true
9 }
10}
diff --git a/recipes/hey/webview.js b/recipes/hey/webview.js
new file mode 100644
index 0000000..d3227af
--- /dev/null
+++ b/recipes/hey/webview.js
@@ -0,0 +1,28 @@
1module.exports = (Ferdi) => {
2 const getMessages = function getMessages() {
3 if (document.location.href == "https://app.hey.com/") {
4 let screener = 0;
5 let unread = 0;
6
7 if (document.getElementsByClassName('btn--icon-screener').length > 0) {
8 let text = document.getElementsByClassName('btn--icon-screener')[0].innerText;
9
10 screener = Ferdi.safeParseInt(/[0-9]+/.exec(text)[0]);
11 }
12
13 let postings = document.getElementsByClassName('posting');
14
15 if (postings.length > 0) {
16 Array.from(postings).forEach(p => {
17 if (p.nodeName == "ARTICLE" && p.getAttribute("data-seen") !== "true") {
18 unread++;
19 }
20 });
21 }
22
23 Ferdi.setBadge(unread, screener);
24 }
25 };
26
27 Ferdi.loop(getMessages);
28}