diff options
author | 2021-09-12 13:08:33 +0530 | |
---|---|---|
committer | 2021-09-12 07:38:33 +0000 | |
commit | 4b3385094ba8a89247be421c81603a8dcbc99753 (patch) | |
tree | 16ccbf79244e55b36af0f5aa9298b93eda5f0402 | |
parent | New recipe: 'clockwise' (#692) (diff) | |
download | ferdium-recipes-4b3385094ba8a89247be421c81603a8dcbc99753.tar.gz ferdium-recipes-4b3385094ba8a89247be421c81603a8dcbc99753.tar.zst ferdium-recipes-4b3385094ba8a89247be421c81603a8dcbc99753.zip |
New recipe: 'misskey' (#693)
-rw-r--r-- | all.json | 9 | ||||
-rw-r--r-- | recipes/misskey/icon.svg | 144 | ||||
-rw-r--r-- | recipes/misskey/index.js | 28 | ||||
-rw-r--r-- | recipes/misskey/package.json | 13 | ||||
-rw-r--r-- | recipes/misskey/webview.js | 9 |
5 files changed, 203 insertions, 0 deletions
@@ -901,6 +901,15 @@ | |||
901 | }, | 901 | }, |
902 | { | 902 | { |
903 | "featured": false, | 903 | "featured": false, |
904 | "id": "misskey", | ||
905 | "name": "Misskey", | ||
906 | "version": "1.0.0", | ||
907 | "icons": { | ||
908 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/misskey/icon.svg" | ||
909 | } | ||
910 | }, | ||
911 | { | ||
912 | "featured": false, | ||
904 | "id": "monday", | 913 | "id": "monday", |
905 | "name": "Monday", | 914 | "name": "Monday", |
906 | "version": "1.1.1", | 915 | "version": "1.1.1", |
diff --git a/recipes/misskey/icon.svg b/recipes/misskey/icon.svg new file mode 100644 index 0000000..2f728ed --- /dev/null +++ b/recipes/misskey/icon.svg | |||
@@ -0,0 +1,144 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
3 | |||
4 | <svg | ||
5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
6 | xmlns:cc="http://creativecommons.org/ns#" | ||
7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
9 | xmlns="http://www.w3.org/2000/svg" | ||
10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
12 | width="512" | ||
13 | height="512" | ||
14 | viewBox="0 0 135.46667 135.46667" | ||
15 | version="1.1" | ||
16 | id="svg8" | ||
17 | inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" | ||
18 | sodipodi:docname="icon.svg" | ||
19 | inkscape:export-filename="icon.png" | ||
20 | inkscape:export-xdpi="192.09196" | ||
21 | inkscape:export-ydpi="192.09196"> | ||
22 | <defs | ||
23 | id="defs2"> | ||
24 | <inkscape:path-effect | ||
25 | effect="simplify" | ||
26 | id="path-effect5115" | ||
27 | is_visible="true" | ||
28 | steps="1" | ||
29 | threshold="0.000408163" | ||
30 | smooth_angles="360" | ||
31 | helper_size="0" | ||
32 | simplify_individual_paths="false" | ||
33 | simplify_just_coalesce="false" | ||
34 | simplifyindividualpaths="false" | ||
35 | simplifyJustCoalesce="false" /> | ||
36 | <inkscape:path-effect | ||
37 | effect="simplify" | ||
38 | id="path-effect5111" | ||
39 | is_visible="true" | ||
40 | steps="1" | ||
41 | threshold="0.000408163" | ||
42 | smooth_angles="360" | ||
43 | helper_size="0" | ||
44 | simplify_individual_paths="false" | ||
45 | simplify_just_coalesce="false" | ||
46 | simplifyindividualpaths="false" | ||
47 | simplifyJustCoalesce="false" /> | ||
48 | <inkscape:path-effect | ||
49 | effect="simplify" | ||
50 | id="path-effect5104" | ||
51 | is_visible="true" | ||
52 | steps="1" | ||
53 | threshold="0.000408163" | ||
54 | smooth_angles="360" | ||
55 | helper_size="0" | ||
56 | simplify_individual_paths="false" | ||
57 | simplify_just_coalesce="false" | ||
58 | simplifyindividualpaths="false" | ||
59 | simplifyJustCoalesce="false" /> | ||
60 | </defs> | ||
61 | <sodipodi:namedview | ||
62 | id="base" | ||
63 | pagecolor="#ffffff" | ||
64 | bordercolor="#666666" | ||
65 | borderopacity="1.0" | ||
66 | inkscape:pageopacity="0.0" | ||
67 | inkscape:pageshadow="2" | ||
68 | inkscape:zoom="1.1601562" | ||
69 | inkscape:cx="256" | ||
70 | inkscape:cy="256" | ||
71 | inkscape:document-units="px" | ||
72 | inkscape:current-layer="g4502" | ||
73 | showgrid="true" | ||
74 | units="px" | ||
75 | inkscape:snap-bbox="true" | ||
76 | inkscape:bbox-nodes="true" | ||
77 | inkscape:snap-bbox-edge-midpoints="false" | ||
78 | inkscape:snap-smooth-nodes="true" | ||
79 | inkscape:snap-center="true" | ||
80 | inkscape:snap-page="true" | ||
81 | inkscape:window-width="1440" | ||
82 | inkscape:window-height="797" | ||
83 | inkscape:window-x="0" | ||
84 | inkscape:window-y="23" | ||
85 | inkscape:window-maximized="0" | ||
86 | inkscape:snap-object-midpoints="true" | ||
87 | inkscape:snap-midpoints="true" | ||
88 | inkscape:object-paths="true" | ||
89 | fit-margin-top="0" | ||
90 | fit-margin-left="0" | ||
91 | fit-margin-right="0" | ||
92 | fit-margin-bottom="0" | ||
93 | objecttolerance="1" | ||
94 | guidetolerance="1" | ||
95 | inkscape:snap-nodes="false" | ||
96 | inkscape:snap-others="false"> | ||
97 | <inkscape:grid | ||
98 | type="xygrid" | ||
99 | id="grid4504" | ||
100 | spacingx="4.2333334" | ||
101 | spacingy="4.2333334" | ||
102 | empcolor="#ff3fff" | ||
103 | empopacity="0.25098039" | ||
104 | empspacing="4" /> | ||
105 | </sodipodi:namedview> | ||
106 | <metadata | ||
107 | id="metadata5"> | ||
108 | <rdf:RDF> | ||
109 | <cc:Work | ||
110 | rdf:about=""> | ||
111 | <dc:format>image/svg+xml</dc:format> | ||
112 | <dc:type | ||
113 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
114 | <dc:title /> | ||
115 | </cc:Work> | ||
116 | </rdf:RDF> | ||
117 | </metadata> | ||
118 | <g | ||
119 | inkscape:label="レイヤー 1" | ||
120 | inkscape:groupmode="layer" | ||
121 | id="layer1" | ||
122 | transform="translate(-30.809093,-111.78601)"> | ||
123 | <g | ||
124 | id="g4502" | ||
125 | transform="matrix(1.096096,0,0,1.096096,-2.960633,-44.023579)"> | ||
126 | <g | ||
127 | style="fill:#00a5c0;fill-opacity:1" | ||
128 | transform="translate(-1.3333333e-6,-1.3439941e-6)" | ||
129 | id="g5125"> | ||
130 | <g | ||
131 | transform="matrix(0.91391326,0,0,0.91391326,7.9719907,17.595761)" | ||
132 | id="text4489" | ||
133 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236000000083px;line-height:476.69509887999998909px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#00a5c0;fill-opacity:1;stroke:none;stroke-width:0.28950601999999998px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
134 | aria-label="Mi"> | ||
135 | <path | ||
136 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#00a5c0;fill-opacity:1;stroke-width:1.09609616000000010px" | ||
137 | d="M 62.474609 76.585938 C 54.999059 76.585938 47.878825 77.832365 41.115234 80.324219 C 29.011968 84.595952 19.044417 92.249798 11.212891 103.28516 C 3.7373405 113.96451 0 125.88934 0 139.06055 L 0 372.93945 C 0 390.02642 6.0510264 404.79858 18.154297 417.25781 C 30.613543 429.36108 45.387643 435.41406 62.474609 435.41406 C 79.917556 435.41406 94.689698 429.36108 106.79297 417.25781 C 119.25222 404.79858 125.48242 390.02642 125.48242 372.93945 L 125.48242 330.4082 C 125.61683 321.19698 135.10492 323.61391 139.90039 330.4082 C 148.8815 345.96215 167.92265 359.32062 190.0918 359.24414 C 212.26095 359.16778 230.67374 348.20715 240.28516 330.4082 C 243.92497 326.11557 254.18418 318.80145 255.23633 330.4082 L 255.23633 372.93945 C 255.23633 390.02642 261.28735 404.79858 273.39062 417.25781 C 285.84985 429.36108 300.62397 435.41406 317.71094 435.41406 C 335.15388 435.41406 349.92603 429.36108 362.0293 417.25781 C 374.48853 404.79858 380.71875 390.02642 380.71875 372.93945 L 380.71875 139.06055 C 380.71875 125.88934 376.80415 113.96451 368.97266 103.28516 C 361.49709 92.249798 351.70678 84.595952 339.60352 80.324219 C 332.48396 77.832365 325.3637 76.585938 318.24414 76.585938 C 299.02128 76.585938 282.82549 84.062587 269.6543 99.013672 C 262.53473 107.20121 258.79542 111.11761 258.43945 110.76172 C 258.43945 110.76172 207.67587 172.14495 206.25195 173.21289 C 204.82804 174.2808 200.11102 182.44531 190.0918 182.44531 C 180.07257 182.44531 175.89071 174.2808 174.4668 173.21289 C 173.04288 172.14495 122.2793 110.76172 122.2793 110.76172 C 121.21136 110.40575 117.29484 106.48923 110.53125 99.013672 C 97.716024 84.062587 81.697447 76.585938 62.474609 76.585938 z M 457.53516 76.585938 C 442.58406 76.585937 429.7692 81.926117 419.08984 92.605469 C 408.76646 102.92885 403.60547 115.56648 403.60547 130.51758 C 403.60547 145.46868 408.76646 158.28354 419.08984 168.96289 C 429.7692 179.28627 442.58406 184.44922 457.53516 184.44922 C 472.48625 184.44922 485.30112 179.28627 495.98047 168.96289 C 506.65982 158.28354 512 145.46868 512 130.51758 C 512 115.56648 506.65982 102.92885 495.98047 92.605469 C 485.30112 81.926117 472.48625 76.585938 457.53516 76.585938 z M 458.06836 195.12695 C 443.11726 195.12695 430.3024 200.46713 419.62305 211.14648 C 408.94369 221.82584 403.60547 234.6407 403.60547 249.5918 L 403.60547 381.48242 C 403.60547 396.43352 408.94369 409.24838 419.62305 419.92773 C 430.3024 430.25112 443.11726 435.41406 458.06836 435.41406 C 473.01946 435.41406 485.65709 430.25112 495.98047 419.92773 C 506.65982 409.24838 512 396.43352 512 381.48242 L 512 249.5918 C 512 234.6407 506.65982 221.82584 495.98047 211.14648 C 485.65709 200.46713 473.01946 195.12695 458.06836 195.12695 z " | ||
138 | transform="matrix(0.26412464,0,0,0.26412464,24.988264,136.28626)" | ||
139 | id="path5210" /> | ||
140 | </g> | ||
141 | </g> | ||
142 | </g> | ||
143 | </g> | ||
144 | </svg> | ||
diff --git a/recipes/misskey/index.js b/recipes/misskey/index.js new file mode 100644 index 0000000..3f51bf9 --- /dev/null +++ b/recipes/misskey/index.js | |||
@@ -0,0 +1,28 @@ | |||
1 | module.exports = Ferdi => class Misskey extends Ferdi { | ||
2 | constructor(...args) { | ||
3 | let _temp; | ||
4 | return _temp = super(...args), this.events = { | ||
5 | }, _temp; | ||
6 | } | ||
7 | |||
8 | async validateUrl(url) { | ||
9 | try { | ||
10 | const res = await window.fetch(`${url}/api/stats`, { | ||
11 | method: 'POST', | ||
12 | headers: { | ||
13 | 'Content-Type': 'application/json', | ||
14 | }, | ||
15 | }); | ||
16 | const data = await res.json(); | ||
17 | // check any field in API response | ||
18 | return [ | ||
19 | 'originalUsersCount', 'usersCount', 'notesCount', 'originalNotesCount' | ||
20 | ].reduce((r, key) => ( | ||
21 | r && Object.hasOwnProperty.call(data, 'uri') | ||
22 | ), true); | ||
23 | } catch (err) { | ||
24 | console.error(err); | ||
25 | } | ||
26 | return false; | ||
27 | } | ||
28 | }; | ||
diff --git a/recipes/misskey/package.json b/recipes/misskey/package.json new file mode 100644 index 0000000..66bdd3c --- /dev/null +++ b/recipes/misskey/package.json | |||
@@ -0,0 +1,13 @@ | |||
1 | { | ||
2 | "id": "misskey", | ||
3 | "name": "Misskey", | ||
4 | "version": "1.0.0", | ||
5 | "license": "MIT", | ||
6 | "repository": "https://github.com/sharkpp/franz-recipe-misskey", | ||
7 | "config": { | ||
8 | "serviceURL": "https://{teamId}", | ||
9 | "hasTeamId": true, | ||
10 | "hasNotificationSound": true, | ||
11 | "message": "Please enter the instance address of Misskey in the team name input box." | ||
12 | } | ||
13 | } | ||
diff --git a/recipes/misskey/webview.js b/recipes/misskey/webview.js new file mode 100644 index 0000000..b024ce1 --- /dev/null +++ b/recipes/misskey/webview.js | |||
@@ -0,0 +1,9 @@ | |||
1 | module.exports = (Ferdi) => { | ||
2 | const getMessages = function getMessages() { | ||
3 | // check notification badge for Ferdi badge | ||
4 | let hasNotification = !!document.querySelector('#app div.notifications > button > i.circle'); | ||
5 | Ferdi.setBadge(0, hasNotification ? 1 : 0); | ||
6 | }; | ||
7 | |||
8 | Ferdi.loop(getMessages); | ||
9 | }; | ||