diff options
Diffstat (limited to 'recipes/twitch')
-rw-r--r-- | recipes/twitch/LICENSE | 25 | ||||
-rw-r--r-- | recipes/twitch/README.md | 30 | ||||
-rw-r--r-- | recipes/twitch/icon.png | bin | 0 -> 24641 bytes | |||
-rw-r--r-- | recipes/twitch/icon.svg | 31 | ||||
-rw-r--r-- | recipes/twitch/index.js | 5 | ||||
-rw-r--r-- | recipes/twitch/package.json | 17 | ||||
-rw-r--r-- | recipes/twitch/webview.js | 13 |
7 files changed, 121 insertions, 0 deletions
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 @@ | |||
1 | MIT License | ||
2 | |||
3 | Copyright (c) 2017 Colin O'Dell <colinodell@gmail.com> | ||
4 | |||
5 | Based on https://github.com/meetfranz/plugins-legacy/pull/30 | ||
6 | Copyright (c) 2016 RedbackThomson <redbackthomson@hotmail.com> | ||
7 | |||
8 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
9 | of this software and associated documentation files (the "Software"), to deal | ||
10 | in the Software without restriction, including without limitation the rights | ||
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
12 | copies of the Software, and to permit persons to whom the Software is | ||
13 | furnished to do so, subject to the following conditions: | ||
14 | |||
15 | The above copyright notice and this permission notice shall be included in all | ||
16 | copies or substantial portions of the Software. | ||
17 | |||
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
24 | SOFTWARE. | ||
25 | |||
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 @@ | |||
1 | # Twitch Chat | ||
2 | Recipe for [Twitch](https://www.twitch.tv) chat integration with [Franz 5](http://meetfranz.com) | ||
3 | |||
4 | ## To test this dev release | ||
5 | |||
6 | 1. Clone/download the folder `twitch`. | ||
7 | |||
8 | 2. 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 | |||
13 | 3. Create a `dev` folder if you have not already done so | ||
14 | |||
15 | 3. Unzip and copy the `twitch` folder into the recipes dev directory | ||
16 | |||
17 | 4. Restart Franz | ||
18 | |||
19 | ## How to create your own Franz recipes: | ||
20 | * [Read the documentation](https://github.com/meetfranz/plugins) | ||
21 | |||
22 | ## Authors | ||
23 | |||
24 | ### Original Author of V4 plugin | ||
25 | |||
26 | - [RedbackThomson](https://github.com/RedbackThomson/) | ||
27 | |||
28 | ### Ported to V5 recipe by | ||
29 | |||
30 | - [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 --- /dev/null +++ b/recipes/twitch/icon.png | |||
Binary files 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 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> | ||
3 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | ||
4 | <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" | ||
5 | width="267.153" height="267.153" viewBox="0 0 255.21 267.153" enable-background="new 0 0 255.21 267.153" | ||
6 | xml:space="preserve"> | ||
7 | <g> | ||
8 | <path fill-rule="evenodd" clip-rule="evenodd" fill="#6441A4" d="M255.21,5.351c0.017-4.656-1.51-5.367-5.656-5.351 | ||
9 | c-37.656,0.148-75.313,0.087-112.969,0.087c-37.99,0-75.98,0.045-113.97-0.079c-3.343-0.011-5.013,0.911-6.235,4.102 | ||
10 | C11.56,16.697,6.473,29.183,1.415,41.677c-0.958,2.366-1.352,4.734-1.35,7.279C0.099,107.94,0.134,166.924,0,225.907 | ||
11 | c-0.009,4.117,1.005,5.332,5.213,5.28c18.825-0.231,37.656-0.014,56.482-0.177c3.511-0.029,4.559,0.981,4.472,4.484 | ||
12 | c-0.229,9.158,0.061,18.329-0.146,27.488c-0.076,3.342,1.066,4.24,4.27,4.166c8.327-0.191,16.662-0.162,24.99-0.007 | ||
13 | c2.731,0.051,4.667-0.809,6.569-2.739c10.055-10.209,20.278-20.252,30.32-30.473c2.032-2.068,4.099-2.93,7.004-2.903 | ||
14 | c14.161,0.132,28.325-0.017,42.487,0.12c3.057,0.029,5.271-0.785,7.469-3c20.891-21.053,41.867-42.02,62.909-62.921 | ||
15 | c2.177-2.162,3.122-4.313,3.117-7.418C255.064,106.989,255.02,56.169,255.21,5.351z M231.133,149.802 | ||
16 | c0.003,2.365-0.739,4.054-2.397,5.697c-11.479,11.373-22.919,22.785-34.266,34.289c-1.833,1.859-3.768,2.344-6.227,2.334 | ||
17 | c-17.824-0.066-35.65,0.093-53.473-0.133c-4.007-0.051-6.833,1.053-9.607,3.916c-10.189,10.518-20.609,20.813-32.073,32.326 | ||
18 | c0-11.346-0.195-21.138,0.094-30.916c0.12-4.063-0.885-5.411-5.167-5.333c-14.821,0.271-29.651,0.005-44.475,0.177 | ||
19 | c-3.43,0.04-4.533-0.852-4.525-4.42c0.109-53.141,0.099-106.281,0.018-159.421c-0.005-3.148,0.744-4.303,4.124-4.298 | ||
20 | c61.303,0.094,122.606,0.096,183.909-0.002c3.447-0.005,4.084,1.258,4.077,4.345C231.062,68.842,231.074,109.323,231.133,149.802z" | ||
21 | /> | ||
22 | <path fill-rule="evenodd" clip-rule="evenodd" fill="#6441A4" d="M126.091,103.574c0,9.822-0.228,19.651,0.105,29.461 | ||
23 | c0.146,4.317-1.313,5.488-5.354,5.121c-3.632-0.33-7.335-0.285-10.976-0.009c-3.563,0.27-4.911-0.649-4.87-4.584 | ||
24 | c0.208-19.974,0.204-39.953,0.002-59.927c-0.04-3.892,1.237-4.885,4.841-4.613c3.807,0.287,7.682,0.359,11.474-0.015 | ||
25 | c4.187-0.414,4.936,1.388,4.852,5.102C125.944,83.927,126.091,93.752,126.091,103.574z"/> | ||
26 | <path fill-rule="evenodd" clip-rule="evenodd" fill="#6441A4" d="M189.088,103.242c0.001,10.321-0.106,20.644,0.065,30.962 | ||
27 | c0.053,3.093-0.925,4.092-3.978,3.938c-4.483-0.225-8.993-0.204-13.479-0.007c-2.887,0.127-3.664-0.975-3.652-3.74 | ||
28 | c0.092-20.642,0.089-41.284,0.007-61.926c-0.011-2.624,0.865-3.508,3.454-3.421c4.656,0.156,9.327,0.187,13.98-0.01 | ||
29 | c2.886-0.122,3.688,0.973,3.653,3.741C189.011,82.932,189.088,93.087,189.088,103.242z"/> | ||
30 | </g> | ||
31 | </svg> | ||
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 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | // just pass through Franz | ||
4 | module.exports = Franz => Franz; | ||
5 | //# 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 @@ | |||
1 | { | ||
2 | "id": "twitch", | ||
3 | "name": "Twitch", | ||
4 | "version": "1.0.0", | ||
5 | "description": "Twitch chat", | ||
6 | "main": "index.js", | ||
7 | "author": "Colin O'Dell <colinodell@gmail.com>; RedbackThomson <redbackthomson@hotmail.com>", | ||
8 | "license": "MIT", | ||
9 | "config": { | ||
10 | "serviceURL": "https://www.twitch.tv/{teamId}/chat", | ||
11 | "hasTeamId": true, | ||
12 | "urlInputPrefix": "https://go.twitch.tv/", | ||
13 | "hasNotificationSound": true, | ||
14 | "hasIndirectMessages": false, | ||
15 | "message": "Twitch chat allows you to not only interact with fellow members of the Twitch Community, but Broadcasters as well." | ||
16 | } | ||
17 | } | ||
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 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = (Franz, options) => { | ||
4 | const getMessages = () => { | ||
5 | // Get the number of mentions | ||
6 | const mentions = document.querySelectorAll('.chat-line .mentioned').length; | ||
7 | |||
8 | Franz.setBadge(mentions, 0); | ||
9 | }; | ||
10 | // check for new messages every second and update Franz badge | ||
11 | Franz.loop(getMessages); | ||
12 | }; | ||
13 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3aXRjaC93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiIsIm9wdGlvbnMiLCJnZXRNZXNzYWdlcyIsIm1lbnRpb25zIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxPQUFPQyxPQUFQLEdBQWlCLENBQUNDLEtBQUQsRUFBUUMsT0FBUixLQUFvQjtBQUNuQyxRQUFNQyxjQUFjLE1BQU07QUFDeEI7QUFDQSxVQUFNQyxXQUFXQyxTQUFTQyxnQkFBVCxDQUEwQix1QkFBMUIsRUFBbURDLE1BQXBFOztBQUVBTixVQUFNTyxRQUFOLENBQWVKLFFBQWYsRUFBeUIsQ0FBekI7QUFDRCxHQUxEO0FBTUE7QUFDQUgsUUFBTVEsSUFBTixDQUFXTixXQUFYO0FBQ0QsQ0FURCIsImZpbGUiOiJ0d2l0Y2gvd2Vidmlldy5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKEZyYW56LCBvcHRpb25zKSA9PiB7XG4gIGNvbnN0IGdldE1lc3NhZ2VzID0gKCkgPT4ge1xuICAgIC8vIEdldCB0aGUgbnVtYmVyIG9mIG1lbnRpb25zXG4gICAgY29uc3QgbWVudGlvbnMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuY2hhdC1saW5lIC5tZW50aW9uZWQnKS5sZW5ndGg7XG5cbiAgICBGcmFuei5zZXRCYWRnZShtZW50aW9ucywgMCk7XG4gIH07XG4gIC8vIGNoZWNrIGZvciBuZXcgbWVzc2FnZXMgZXZlcnkgc2Vjb25kIGFuZCB1cGRhdGUgRnJhbnogYmFkZ2VcbiAgRnJhbnoubG9vcChnZXRNZXNzYWdlcyk7XG59O1xuIl19 \ No newline at end of file | ||