From 5f86784ab1b38e07824ab5238b82fb66186a6985 Mon Sep 17 00:00:00 2001 From: sulthankarimov Date: Thu, 9 May 2024 10:06:07 +0700 Subject: add upwork recipe (#547) --- recipes/upwork/icon.svg | 45 +++++++++++++++++++++++++++++++++++++++++++++ recipes/upwork/index.js | 1 + recipes/upwork/package.json | 9 +++++++++ recipes/upwork/webview.js | 17 +++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 recipes/upwork/icon.svg create mode 100644 recipes/upwork/index.js create mode 100644 recipes/upwork/package.json create mode 100644 recipes/upwork/webview.js diff --git a/recipes/upwork/icon.svg b/recipes/upwork/icon.svg new file mode 100644 index 0000000..f94e0e4 --- /dev/null +++ b/recipes/upwork/icon.svg @@ -0,0 +1,45 @@ + + + + + + + diff --git a/recipes/upwork/index.js b/recipes/upwork/index.js new file mode 100644 index 0000000..dd41f72 --- /dev/null +++ b/recipes/upwork/index.js @@ -0,0 +1 @@ +module.exports = Ferdium => Ferdium; diff --git a/recipes/upwork/package.json b/recipes/upwork/package.json new file mode 100644 index 0000000..ea45045 --- /dev/null +++ b/recipes/upwork/package.json @@ -0,0 +1,9 @@ +{ + "id": "upwork", + "name": "upwork", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://www.upwork.com/ab/notifications/" + } +} diff --git a/recipes/upwork/webview.js b/recipes/upwork/webview.js new file mode 100644 index 0000000..6a2492c --- /dev/null +++ b/recipes/upwork/webview.js @@ -0,0 +1,17 @@ +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +const _path = _interopRequireDefault(require('path')); + +module.exports = Ferdium => { + const getMessages = () => { + const directMessages = $('li .notification-row .d-inline-block')?.textContent; + + Ferdium.setBadge(directMessages); + }; + + Ferdium.loop(getMessages); + + Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); +}; -- cgit v1.2.3-54-g00ecf