From 82ec0881877157aeb1a071e3b6f201ad72dd23ef Mon Sep 17 00:00:00 2001 From: RoiArthurB Date: Wed, 15 Apr 2020 20:06:58 +0700 Subject: Add new Zalo recipe --- all.json | 11 ++++++ archives/zalo.tar.gz | Bin 0 -> 122393 bytes uncompressed/zalo/LICENSE | 21 +++++++++++ uncompressed/zalo/README.md | 5 +++ uncompressed/zalo/icon.png | Bin 0 -> 131572 bytes uncompressed/zalo/icon.svg | 78 +++++++++++++++++++++++++++++++++++++++++ uncompressed/zalo/index.js | 3 ++ uncompressed/zalo/package.json | 18 ++++++++++ uncompressed/zalo/webview.js | 14 ++++++++ 9 files changed, 150 insertions(+) create mode 100644 archives/zalo.tar.gz create mode 100644 uncompressed/zalo/LICENSE create mode 100644 uncompressed/zalo/README.md create mode 100644 uncompressed/zalo/icon.png create mode 100644 uncompressed/zalo/icon.svg create mode 100644 uncompressed/zalo/index.js create mode 100644 uncompressed/zalo/package.json create mode 100644 uncompressed/zalo/webview.js diff --git a/all.json b/all.json index 80ffa66..6458f1b 100644 --- a/all.json +++ b/all.json @@ -1022,6 +1022,17 @@ "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/yammer/icon.svg" } }, + { + "author": "RoiArthurB ", + "featured": false, + "id": "zalo", + "name": "Zalo", + "version": "1.0.0", + "icons": { + "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/zalo/icon.png", + "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/zalo/icon.svg" + } + }, { "author": "Stefan Malzner ", "featured": false, diff --git a/archives/zalo.tar.gz b/archives/zalo.tar.gz new file mode 100644 index 0000000..99890b5 Binary files /dev/null and b/archives/zalo.tar.gz differ diff --git a/uncompressed/zalo/LICENSE b/uncompressed/zalo/LICENSE new file mode 100644 index 0000000..ef601f9 --- /dev/null +++ b/uncompressed/zalo/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Arthur Brugiere + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/uncompressed/zalo/README.md b/uncompressed/zalo/README.md new file mode 100644 index 0000000..c53df0a --- /dev/null +++ b/uncompressed/zalo/README.md @@ -0,0 +1,5 @@ +# Zalo for Ferdi +This is a Ferdi recipe for Zalo + +### How to create your own Ferdi recipes: +* [Read the documentation](https://github.com/getferdi/recipes/blob/master/docs/integration.md) diff --git a/uncompressed/zalo/icon.png b/uncompressed/zalo/icon.png new file mode 100644 index 0000000..9633272 Binary files /dev/null and b/uncompressed/zalo/icon.png differ diff --git a/uncompressed/zalo/icon.svg b/uncompressed/zalo/icon.svg new file mode 100644 index 0000000..02c62b4 --- /dev/null +++ b/uncompressed/zalo/icon.svg @@ -0,0 +1,78 @@ + + + + + + image/svg+xml + + + + + + + + logo-zalo-vector + + + + + + + diff --git a/uncompressed/zalo/index.js b/uncompressed/zalo/index.js new file mode 100644 index 0000000..e8243fb --- /dev/null +++ b/uncompressed/zalo/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = Franz => Franz; \ No newline at end of file diff --git a/uncompressed/zalo/package.json b/uncompressed/zalo/package.json new file mode 100644 index 0000000..8e2417c --- /dev/null +++ b/uncompressed/zalo/package.json @@ -0,0 +1,18 @@ +{ + "id": "zalo", + "name": "Zalo", + "version": "1.0.0", + "description": "Zalo", + "main": "index.js", + "author": "RoiArthurB ", + "license": "MIT", + "config": { + "serviceURL": "https://chat.zalo.me/", + "hasNotificationSound": true, + "hasDirectMessages": true, + "hasIndirectMessages": false, + "hasTeamID": false, + "hasPredefinedUrl": true, + "hasCustomUrl": false + } +} diff --git a/uncompressed/zalo/webview.js b/uncompressed/zalo/webview.js new file mode 100644 index 0000000..e20c6b5 --- /dev/null +++ b/uncompressed/zalo/webview.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = Franz => { + const getMessages = function getMessages() { + var unread = 0 + const notificationBadge = document.getElementsByClassName('notification-badge')[0] + if (notificationBadge != undefined) { + unread = notificationBadge.innerText; + } + Franz.setBadge(parseInt(unread, 10)); + }; + + Franz.loop(getMessages); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2