aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/wechat
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-09-22 20:56:48 +0200
committerLibravatar GitHub <noreply@github.com>2020-09-22 19:56:48 +0100
commit6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch)
tree9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /recipes/wechat
parentUpdated logos for Outlook/OWA (diff)
downloadferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz
ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst
ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'recipes/wechat')
-rw-r--r--recipes/wechat/LICENSE21
-rw-r--r--recipes/wechat/README.md26
-rw-r--r--recipes/wechat/icon.pngbin0 -> 56714 bytes
-rw-r--r--recipes/wechat/icon.svg1
-rw-r--r--recipes/wechat/index.js6
-rw-r--r--recipes/wechat/package.json15
-rw-r--r--recipes/wechat/service.css9
-rw-r--r--recipes/wechat/webview.js34
8 files changed, 112 insertions, 0 deletions
diff --git a/recipes/wechat/LICENSE b/recipes/wechat/LICENSE
new file mode 100644
index 0000000..eee14ce
--- /dev/null
+++ b/recipes/wechat/LICENSE
@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) 2017 Koma
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/wechat/README.md b/recipes/wechat/README.md
new file mode 100644
index 0000000..962f0da
--- /dev/null
+++ b/recipes/wechat/README.md
@@ -0,0 +1,26 @@
1# WeChat
2Recipe for [WeChat](https://www.wechat.com) integration with [Franz 5](http://meetfranz.com)
3
4## To test this dev release
5
61. Clone/download the folder `recipe-wechat`.
7
82. Open the Franz Recipe folder on your machine:
9 * Mac: `~/Library/Application Support/Franz/recipes/`
10 * Windows: `%appdata%/Franz/recipes/`
11 * Linux: `~/.config/Franz/recipes/`
12
133. Create a `dev` folder if you have not already done so
14
153. Unzip and copy the `recipe-wechat` folder into the recipes dev directory
16
174. Restart Franz
18
19## How to create your own Franz recipes:
20[Read the documentation](https://github.com/meetfranz/plugins)
21
22## WeChat logo resources
23Uses unofficial logos acquired from https://github.com/RayPS/WeChat-Logo
24
25## Authors
26[Koma](https://github.com/koma-private/)
diff --git a/recipes/wechat/icon.png b/recipes/wechat/icon.png
new file mode 100644
index 0000000..317e2d7
--- /dev/null
+++ b/recipes/wechat/icon.png
Binary files differ
diff --git a/recipes/wechat/icon.svg b/recipes/wechat/icon.svg
new file mode 100644
index 0000000..e494f53
--- /dev/null
+++ b/recipes/wechat/icon.svg
@@ -0,0 +1 @@
<svg width="1024" height="1024" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="a"><stop stop-color="#00E222" offset="0%"/><stop stop-color="#00C31D" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M357.01 0h309.98c102.802 0 154.19 0 209.528 17.493a217.48 217.48 0 0 1 129.989 129.989C1024 202.812 1024 254.217 1024 357.009v309.982c0 102.801 0 154.189-17.493 209.527a217.445 217.445 0 0 1-129.989 129.98C821.18 1024 769.792 1024 666.991 1024H357.009c-102.801 0-154.197 0-209.527-17.502a217.445 217.445 0 0 1-129.989-129.98C0 821.18 0 769.792 0 666.991V357.009c0-102.792 0-154.197 17.493-209.527A217.48 217.48 0 0 1 147.482 17.493C202.812 0 254.208 0 357.009 0" fill="url(#a)"/><path d="M760 576c18.778 0 34-15.222 34-34s-15.222-34-34-34-34 15.222-34 34 15.222 34 34 34zm-166 0c18.778 0 34-15.222 34-34s-15.222-34-34-34-34 15.222-34 34 15.222 34 34 34zm-95-197c22.091 0 40-17.909 40-40s-17.909-40-40-40c-22.092 0-40 17.909-40 40s17.908 40 40 40zm-201 0c22.091 0 40-17.909 40-40s-17.909-40-40-40c-22.09 0-40 17.909-40 40s17.91 40 40 40zm478.857 428.16c-4.248-2.46-9.32-3.021-14.018-1.601-26.635 8.05-55.373 12.44-85.339 12.44C539.153 818 427 724.428 427 609c0-115.427 112.153-209 250.5-209C815.847 400 928 493.572 928 609c0 63.757-34.217 120.846-88.164 159.18a12.772 12.772 0 0 0-4.947 13.65l11.792 44.985c3.531 13.468-3.439 18.779-15.488 11.803l-54.336-31.457zM297.553 655.417c31.696 9.44 65.85 14.582 101.447 14.582 5.431 0 10.827-.119 16.187-.356C408.55 650.038 405 629.361 405 608c0-125.92 123.346-228 275.5-228 5.32 0 10.604.125 15.85.371C673.775 260.61 549.242 169 399 169 232.762 169 98 281.151 98 419.5c0 76.051 40.724 144.188 105.013 190.13 6.053 4.325 8.825 11.923 6.9 19.11l-14.149 52.79c-4.27 15.933 3.891 22.166 18.136 13.848l64.453-37.633c5.806-3.39 12.756-4.249 19.2-2.328z" fill="#FFF"/></g></svg> \ No newline at end of file
diff --git a/recipes/wechat/index.js b/recipes/wechat/index.js
new file mode 100644
index 0000000..37c403f
--- /dev/null
+++ b/recipes/wechat/index.js
@@ -0,0 +1,6 @@
1'use strict';
2
3// just pass through Franz
4
5module.exports = Franz => Franz;
6//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlY2hhdC9pbmRleC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBOztBQUNBQSxPQUFPQyxPQUFQLEdBQWlCQyxTQUFTQSxLQUExQiIsImZpbGUiOiJ3ZWNoYXQvaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbi8vIGp1c3QgcGFzcyB0aHJvdWdoIEZyYW56XG5tb2R1bGUuZXhwb3J0cyA9IEZyYW56ID0+IEZyYW56OyJdfQ== \ No newline at end of file
diff --git a/recipes/wechat/package.json b/recipes/wechat/package.json
new file mode 100644
index 0000000..85ad7e9
--- /dev/null
+++ b/recipes/wechat/package.json
@@ -0,0 +1,15 @@
1{
2 "id": "wechat",
3 "name": "WeChat",
4 "version": "1.0.1",
5 "description": "Instant messaging",
6 "main": "index.js",
7 "author": "Koma",
8 "license": "MIT",
9 "repository": "https://github.com/koma-private/recipe-wechat",
10 "config": {
11 "hasNotificationSound": true,
12 "hasIndirectMessages": true,
13 "serviceURL": "https://web.wechat.com/"
14 }
15} \ No newline at end of file
diff --git a/recipes/wechat/service.css b/recipes/wechat/service.css
new file mode 100644
index 0000000..0e45c65
--- /dev/null
+++ b/recipes/wechat/service.css
@@ -0,0 +1,9 @@
1.main {
2 padding-top: 0;
3 height: 100vh;
4}
5
6.main_inner {
7 margin: 0;
8 max-width: 100%;
9}
diff --git a/recipes/wechat/webview.js b/recipes/wechat/webview.js
new file mode 100644
index 0000000..8b81a33
--- /dev/null
+++ b/recipes/wechat/webview.js
@@ -0,0 +1,34 @@
1'use strict';
2
3const path = require('path');
4
5module.exports = (Franz, options) => {
6 function getMessages() {
7 let directCount = 0;
8 let indirectCount = 0;
9 let chat_item = document.querySelectorAll('div.chat_item');
10
11 Array.prototype.forEach.call(chat_item, function (item) {
12 let count = 0;
13 let reddot = item.querySelector("i.web_wechat_reddot_middle");
14 let avatarImage = item.querySelector("img.img");
15
16 if (reddot && reddot.innerText) {
17 count = parseInt(reddot.innerText);
18 }
19
20 if (avatarImage && avatarImage.getAttribute("src").search("webwxgeticon") != -1) {
21 directCount += count;
22 } else {
23 indirectCount += count;
24 }
25 });
26
27 Franz.setBadge(directCount, indirectCount);
28 }
29
30 Franz.injectCSS(path.join(__dirname, 'service.css'));
31
32 Franz.loop(getMessages);
33};
34//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlY2hhdC93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbInBhdGgiLCJyZXF1aXJlIiwibW9kdWxlIiwiZXhwb3J0cyIsIkZyYW56Iiwib3B0aW9ucyIsImdldE1lc3NhZ2VzIiwiZGlyZWN0Q291bnQiLCJpbmRpcmVjdENvdW50IiwiY2hhdF9pdGVtIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwiQXJyYXkiLCJwcm90b3R5cGUiLCJmb3JFYWNoIiwiY2FsbCIsIml0ZW0iLCJjb3VudCIsInJlZGRvdCIsInF1ZXJ5U2VsZWN0b3IiLCJhdmF0YXJJbWFnZSIsImlubmVyVGV4dCIsInBhcnNlSW50IiwiZ2V0QXR0cmlidXRlIiwic2VhcmNoIiwic2V0QmFkZ2UiLCJpbmplY3RDU1MiLCJqb2luIiwiX19kaXJuYW1lIiwibG9vcCJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBQ0EsTUFBTUEsT0FBT0MsUUFBUSxNQUFSLENBQWI7O0FBRUFDLE9BQU9DLE9BQVAsR0FBaUIsQ0FBQ0MsS0FBRCxFQUFRQyxPQUFSLEtBQW9CO0FBQ25DLFdBQVNDLFdBQVQsR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