From 6f5e4a00588aefdda7a5a1cfe70935870e7e234a Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 22 Sep 2020 20:56:48 +0200 Subject: Unpack recipes and update recipes icons (#292) Co-authored-by: Amine Mouafik --- recipes/twitch/LICENSE | 25 +++++++++++++++++++++++++ recipes/twitch/README.md | 30 ++++++++++++++++++++++++++++++ recipes/twitch/icon.png | Bin 0 -> 24641 bytes recipes/twitch/icon.svg | 31 +++++++++++++++++++++++++++++++ recipes/twitch/index.js | 5 +++++ recipes/twitch/package.json | 17 +++++++++++++++++ recipes/twitch/webview.js | 13 +++++++++++++ 7 files changed, 121 insertions(+) create mode 100644 recipes/twitch/LICENSE create mode 100644 recipes/twitch/README.md create mode 100644 recipes/twitch/icon.png create mode 100644 recipes/twitch/icon.svg create mode 100644 recipes/twitch/index.js create mode 100644 recipes/twitch/package.json create mode 100644 recipes/twitch/webview.js (limited to 'recipes/twitch') diff --git a/recipes/twitch/LICENSE b/recipes/twitch/LICENSE new file mode 100644 index 0000000..6db1c9e --- /dev/null +++ b/recipes/twitch/LICENSE @@ -0,0 +1,25 @@ +MIT License + +Copyright (c) 2017 Colin O'Dell + +Based on https://github.com/meetfranz/plugins-legacy/pull/30 +Copyright (c) 2016 RedbackThomson + +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/recipes/twitch/README.md b/recipes/twitch/README.md new file mode 100644 index 0000000..69926fb --- /dev/null +++ b/recipes/twitch/README.md @@ -0,0 +1,30 @@ +# Twitch Chat +Recipe for [Twitch](https://www.twitch.tv) chat integration with [Franz 5](http://meetfranz.com) + +## To test this dev release + +1. Clone/download the folder `twitch`. + +2. Open the Franz Recipe folder on your machine: + * Mac: `~/Library/Application Support/Franz/recipes/` + * Windows: `%appdata%/Franz/recipes/` + * Linux: `~/.config/Franz/recipes/` + +3. Create a `dev` folder if you have not already done so + +3. Unzip and copy the `twitch` folder into the recipes dev directory + +4. Restart Franz + +## How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) + +## Authors + +### Original Author of V4 plugin + +- [RedbackThomson](https://github.com/RedbackThomson/) + +### Ported to V5 recipe by + +- [Colin O'Dell](https://github.com/colinodell/) diff --git a/recipes/twitch/icon.png b/recipes/twitch/icon.png new file mode 100644 index 0000000..4258b59 Binary files /dev/null and b/recipes/twitch/icon.png differ diff --git a/recipes/twitch/icon.svg b/recipes/twitch/icon.svg new file mode 100644 index 0000000..211e155 --- /dev/null +++ b/recipes/twitch/icon.svg @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/recipes/twitch/index.js b/recipes/twitch/index.js new file mode 100644 index 0000000..c99e0b6 --- /dev/null +++ b/recipes/twitch/index.js @@ -0,0 +1,5 @@ +"use strict"; + +// just pass through Franz +module.exports = Franz => Franz; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3aXRjaC9pbmRleC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiXSwibWFwcGluZ3MiOiI7O0FBQUE7QUFDQUEsT0FBT0MsT0FBUCxHQUFpQkMsU0FBU0EsS0FBMUIiLCJmaWxlIjoidHdpdGNoL2luZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8ganVzdCBwYXNzIHRocm91Z2ggRnJhbnpcbm1vZHVsZS5leHBvcnRzID0gRnJhbnogPT4gRnJhbno7XG4iXX0= \ No newline at end of file diff --git a/recipes/twitch/package.json b/recipes/twitch/package.json new file mode 100644 index 0000000..9dfc0ce --- /dev/null +++ b/recipes/twitch/package.json @@ -0,0 +1,17 @@ +{ + "id": "twitch", + "name": "Twitch", + "version": "1.0.0", + "description": "Twitch chat", + "main": "index.js", + "author": "Colin O'Dell ; RedbackThomson ", + "license": "MIT", + "config": { + "serviceURL": "https://www.twitch.tv/{teamId}/chat", + "hasTeamId": true, + "urlInputPrefix": "https://go.twitch.tv/", + "hasNotificationSound": true, + "hasIndirectMessages": false, + "message": "Twitch chat allows you to not only interact with fellow members of the Twitch Community, but Broadcasters as well." + } +} diff --git a/recipes/twitch/webview.js b/recipes/twitch/webview.js new file mode 100644 index 0000000..2719e25 --- /dev/null +++ b/recipes/twitch/webview.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = (Franz, options) => { + const getMessages = () => { + // Get the number of mentions + const mentions = document.querySelectorAll('.chat-line .mentioned').length; + + Franz.setBadge(mentions, 0); + }; + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3aXRjaC93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiIsIm9wdGlvbnMiLCJnZXRNZXNzYWdlcyIsIm1lbnRpb25zIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxPQUFPQyxPQUFQLEdBQWlCL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