aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/notion
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/notion')
-rw-r--r--recipes/notion/README.md8
-rw-r--r--recipes/notion/icon.pngbin0 -> 43926 bytes
-rw-r--r--recipes/notion/icon.svg7
-rw-r--r--recipes/notion/index.js3
-rw-r--r--recipes/notion/package.json15
-rw-r--r--recipes/notion/webview.js17
6 files changed, 50 insertions, 0 deletions
diff --git a/recipes/notion/README.md b/recipes/notion/README.md
new file mode 100644
index 0000000..ac5c10a
--- /dev/null
+++ b/recipes/notion/README.md
@@ -0,0 +1,8 @@
1# Ferdi-notion
2A Notion recipe for Ferdi
3
4### Release notes
51.0.0: First version
6
7### How to create your own Ferdi recipes:
8* [Read the documentation](https://github.com/getferdi/recipes/blob/master/docs/integration.md)
diff --git a/recipes/notion/icon.png b/recipes/notion/icon.png
new file mode 100644
index 0000000..cb3b715
--- /dev/null
+++ b/recipes/notion/icon.png
Binary files differ
diff --git a/recipes/notion/icon.svg b/recipes/notion/icon.svg
new file mode 100644
index 0000000..58047ab
--- /dev/null
+++ b/recipes/notion/icon.svg
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024pt" height="1024pt" viewBox="0 0 1024 1024" version="1.1">
3<g id="surface1">
4<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 512 1024 C 794.769531 1024 1024 794.769531 1024 512 C 1024 229.230469 794.769531 0 512 0 C 229.230469 0 0 229.230469 0 512 C 0 794.769531 229.230469 1024 512 1024 Z M 512 1024 "/>
5<path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 607.152344 193.460938 L 251.957031 219.597656 C 223.316406 222.074219 213.332031 240.746094 213.332031 263.128906 L 213.332031 651.339844 C 213.332031 668.78125 219.554688 683.691406 234.515625 703.617188 L 318.015625 811.867188 C 331.730469 829.300781 344.191406 833.027344 370.378906 831.78125 L 782.867188 806.890625 C 817.753906 804.414062 827.734375 788.226562 827.734375 760.851562 L 827.734375 324.105469 C 827.734375 309.957031 822.132812 305.867188 805.613281 293.820312 C 804.707031 293.160156 803.761719 292.472656 802.789062 291.757812 L 689.40625 212.125 C 661.992188 192.226562 650.769531 189.722656 607.152344 193.460938 Z M 379.734375 316.941406 C 346.054688 319.214844 338.402344 319.730469 319.277344 304.203125 L 270.644531 265.632812 C 265.683594 260.644531 268.171875 254.425781 280.628906 253.191406 L 622.109375 228.304688 C 650.761719 225.808594 665.714844 235.78125 676.9375 244.484375 L 735.507812 286.792969 C 738 288.035156 744.222656 295.488281 736.742188 295.488281 L 384.082031 316.652344 Z M 340.453125 757.113281 L 340.453125 386.332031 C 340.453125 370.160156 345.4375 362.6875 360.382812 361.429688 L 765.402344 337.796875 C 779.140625 336.554688 785.359375 345.269531 785.359375 361.429688 L 785.359375 729.726562 C 785.359375 745.914062 782.859375 759.621094 760.421875 760.851562 L 372.847656 783.265625 C 350.417969 784.496094 340.453125 777.042969 340.453125 757.113281 Z M 723.0625 406.222656 C 725.546875 417.429688 723.0625 428.628906 711.824219 429.890625 L 693.148438 433.609375 L 693.148438 707.34375 C 676.9375 716.050781 661.984375 721.03125 649.527344 721.03125 C 629.582031 721.03125 624.585938 714.804688 609.644531 696.148438 L 487.496094 504.535156 L 487.496094 689.929688 L 526.144531 698.644531 C 526.144531 698.644531 526.144531 721.03125 494.964844 721.03125 L 408.992188 726.015625 C 406.496094 721.03125 408.992188 708.597656 417.714844 706.105469 L 440.148438 699.894531 L 440.148438 454.765625 L 409 452.273438 C 406.5 441.066406 412.722656 424.902344 430.183594 423.648438 L 522.410156 417.4375 L 649.527344 611.546875 L 649.527344 439.828125 L 617.117188 436.113281 C 614.628906 422.410156 624.585938 412.457031 637.050781 411.222656 Z M 723.0625 406.222656 "/>
6</g>
7</svg>
diff --git a/recipes/notion/index.js b/recipes/notion/index.js
new file mode 100644
index 0000000..17daa35
--- /dev/null
+++ b/recipes/notion/index.js
@@ -0,0 +1,3 @@
1"use strict";
2
3module.exports = Franz => Franz;
diff --git a/recipes/notion/package.json b/recipes/notion/package.json
new file mode 100644
index 0000000..d94b340
--- /dev/null
+++ b/recipes/notion/package.json
@@ -0,0 +1,15 @@
1{
2 "id": "notion",
3 "name": "Notion",
4 "version": "1.0.1",
5 "description": "Notion",
6 "main": "index.js",
7 "author": "Tania R. Zuniga <tania@tanx.dev>",
8 "license": "MIT",
9 "repository": "https://github.com/TanZng/ferdi-notion",
10 "config": {
11 "serviceURL": "https://www.notion.so/",
12 "hasIndirectMessages": true,
13 "hasNotificationSound": true
14 }
15}
diff --git a/recipes/notion/webview.js b/recipes/notion/webview.js
new file mode 100644
index 0000000..5308626
--- /dev/null
+++ b/recipes/notion/webview.js
@@ -0,0 +1,17 @@
1"use strict";
2
3module.exports = (Franz) => {
4 function getMessages() {
5 let direct = 0;
6 let indirect = 0;
7 const badgeDiv = document.querySelector('.notion-sidebar-container > div > div > div > :nth-child(4) > :nth-child(2) > div > :nth-child(3) > div > div');
8 if (badgeDiv) {
9 const count = parseInt(badgeDiv.innerText);
10 direct = isNaN(count) ? 0 : count;
11 }
12
13 Franz.setBadge(direct, indirect);
14 }
15
16 Franz.loop(getMessages);
17}