diff options
Diffstat (limited to 'uncompressed/twitter')
-rw-r--r-- | uncompressed/twitter/LICENSE | 21 | ||||
-rw-r--r-- | uncompressed/twitter/README.md | 21 | ||||
-rwxr-xr-x | uncompressed/twitter/icon.png | bin | 0 -> 4298 bytes | |||
-rwxr-xr-x | uncompressed/twitter/icon.svg | 1 | ||||
-rw-r--r-- | uncompressed/twitter/index.js | 3 | ||||
-rw-r--r-- | uncompressed/twitter/package.json | 17 | ||||
-rw-r--r-- | uncompressed/twitter/webview.js | 17 |
7 files changed, 80 insertions, 0 deletions
diff --git a/uncompressed/twitter/LICENSE b/uncompressed/twitter/LICENSE new file mode 100644 index 0000000..0c2c44e --- /dev/null +++ b/uncompressed/twitter/LICENSE | |||
@@ -0,0 +1,21 @@ | |||
1 | MIT License | ||
2 | |||
3 | Copyright (c) 2019 Jason White & the Ferdi Team | ||
4 | |||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | of this software and associated documentation files (the "Software"), to deal | ||
7 | in the Software without restriction, including without limitation the rights | ||
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | copies of the Software, and to permit persons to whom the Software is | ||
10 | furnished to do so, subject to the following conditions: | ||
11 | |||
12 | The above copyright notice and this permission notice shall be included in all | ||
13 | copies or substantial portions of the Software. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
21 | SOFTWARE. | ||
diff --git a/uncompressed/twitter/README.md b/uncompressed/twitter/README.md new file mode 100644 index 0000000..51a7ae5 --- /dev/null +++ b/uncompressed/twitter/README.md | |||
@@ -0,0 +1,21 @@ | |||
1 | # Twitter for Franz | ||
2 | This is a [Twitter](https://twitter.com) recipe for [Ferdi](https://getferdi.com). | ||
3 | |||
4 | * Notifications and Messages display a direct messages badge. | ||
5 | |||
6 | |||
7 | ## Installation | ||
8 | |||
9 | To install a new recipe: | ||
10 | |||
11 | 1. Open the Franz `recipes` directory on your machine (create the `dev` directory if it doesn't exist): | ||
12 | * Mac: `~/Library/Application Support/Franz/recipes/dev/` | ||
13 | * Linux: `~/.config/Franz/recipes/dev/` | ||
14 | * Windows: `%appdata%/Franz/recipes/dev/` | ||
15 | 2. Clone or copy the contents of this repo to a directory named `twitter` in the `dev` folder. | ||
16 | 3. Reload Franz. | ||
17 | 4. Add a new service. Click the "Development" button under available services | ||
18 | to see the recipes added in `.../recipes/dev/`. | ||
19 | |||
20 | ## References | ||
21 | * [Franz Integration Documentation](https://github.com/meetfranz/plugins/tree/master/docs) | ||
diff --git a/uncompressed/twitter/icon.png b/uncompressed/twitter/icon.png new file mode 100755 index 0000000..b5eebc8 --- /dev/null +++ b/uncompressed/twitter/icon.png | |||
Binary files differ | |||
diff --git a/uncompressed/twitter/icon.svg b/uncompressed/twitter/icon.svg new file mode 100755 index 0000000..2832e7b --- /dev/null +++ b/uncompressed/twitter/icon.svg | |||
@@ -0,0 +1 @@ | |||
<svg id="Logo_FIXED" data-name="Logo — FIXED" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><defs><style>.cls-1{fill:none;}.cls-2{fill:#1da1f2;}</style></defs><title>Twitter_Logo_Blue</title><rect class="cls-1" width="400" height="400"/><path class="cls-2" d="M153.62,301.59c94.34,0,145.94-78.16,145.94-145.94,0-2.22,0-4.43-.15-6.63A104.36,104.36,0,0,0,325,122.47a102.38,102.38,0,0,1-29.46,8.07,51.47,51.47,0,0,0,22.55-28.37,102.79,102.79,0,0,1-32.57,12.45,51.34,51.34,0,0,0-87.41,46.78A145.62,145.62,0,0,1,92.4,107.81a51.33,51.33,0,0,0,15.88,68.47A50.91,50.91,0,0,1,85,169.86c0,.21,0,.43,0,.65a51.31,51.31,0,0,0,41.15,50.28,51.21,51.21,0,0,1-23.16.88,51.35,51.35,0,0,0,47.92,35.62,102.92,102.92,0,0,1-63.7,22A104.41,104.41,0,0,1,75,278.55a145.21,145.21,0,0,0,78.62,23"/></svg> \ No newline at end of file | |||
diff --git a/uncompressed/twitter/index.js b/uncompressed/twitter/index.js new file mode 100644 index 0000000..e8243fb --- /dev/null +++ b/uncompressed/twitter/index.js | |||
@@ -0,0 +1,3 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => Franz; \ No newline at end of file | ||
diff --git a/uncompressed/twitter/package.json b/uncompressed/twitter/package.json new file mode 100644 index 0000000..407a1a4 --- /dev/null +++ b/uncompressed/twitter/package.json | |||
@@ -0,0 +1,17 @@ | |||
1 | { | ||
2 | "id": "twitter", | ||
3 | "name": "Twitter", | ||
4 | "version": "1.1.0", | ||
5 | "description": "Twitter", | ||
6 | "main": "index.js", | ||
7 | "author": "Ferdi Team <hello@getferdi.com> and Jason White <jdwhite@menelos.com>", | ||
8 | "license": "MIT", | ||
9 | "repository": "https://github.com/getferdi/recipes", | ||
10 | "config": { | ||
11 | "serviceURL": "https://twitter.com", | ||
12 | "hasNotificationSound": true, | ||
13 | "hasDirectMessages": true, | ||
14 | "hasIndirectMessages": false, | ||
15 | "hasTeamId": false | ||
16 | } | ||
17 | } | ||
diff --git a/uncompressed/twitter/webview.js b/uncompressed/twitter/webview.js new file mode 100644 index 0000000..75655f1 --- /dev/null +++ b/uncompressed/twitter/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = () => { | ||
5 | var direct = 0; | ||
6 | |||
7 | // "Notifications" and "Messages" - aria-label ending in | ||
8 | // "unread items". Sum the values for direct badge. | ||
9 | direct += document.querySelector('[data-testid=AppTabBar_Notifications_Link] div div div').innerHTML; | ||
10 | direct += document.querySelector('[data-testid=AppTabBar_DirectMessage_Link] div div div').innerHTML; | ||
11 | |||
12 | Franz.setBadge(direct); | ||
13 | }; | ||
14 | |||
15 | Franz.loop(getMessages); | ||
16 | |||
17 | }; \ No newline at end of file | ||