From f90e9581a651c9aa691fc4271613d4d75f4713a3 Mon Sep 17 00:00:00 2001 From: sulthankarimov Date: Thu, 9 May 2024 08:22:41 +0700 Subject: [PATCH] add recipes for freelancers (#534) --- recipes/guru/icon.svg | 62 +++++++++++++++++++++++++ recipes/guru/index.js | 1 + recipes/guru/package.json | 9 ++++ recipes/guru/webview.js | 19 ++++++++ recipes/peopleperhour/icon.svg | 74 ++++++++++++++++++++++++++++++ recipes/peopleperhour/index.js | 1 + recipes/peopleperhour/package.json | 9 ++++ recipes/peopleperhour/webview.js | 19 ++++++++ recipes/truelancer/icon.svg | 62 +++++++++++++++++++++++++ recipes/truelancer/index.js | 1 + recipes/truelancer/package.json | 9 ++++ recipes/truelancer/webview.js | 19 ++++++++ 12 files changed, 285 insertions(+) create mode 100644 recipes/guru/icon.svg create mode 100644 recipes/guru/index.js create mode 100644 recipes/guru/package.json create mode 100644 recipes/guru/webview.js create mode 100644 recipes/peopleperhour/icon.svg create mode 100644 recipes/peopleperhour/index.js create mode 100644 recipes/peopleperhour/package.json create mode 100644 recipes/peopleperhour/webview.js create mode 100644 recipes/truelancer/icon.svg create mode 100644 recipes/truelancer/index.js create mode 100644 recipes/truelancer/package.json create mode 100644 recipes/truelancer/webview.js diff --git a/recipes/guru/icon.svg b/recipes/guru/icon.svg new file mode 100644 index 000000000..8b19048ca --- /dev/null +++ b/recipes/guru/icon.svg @@ -0,0 +1,62 @@ + + + + diff --git a/recipes/guru/index.js b/recipes/guru/index.js new file mode 100644 index 000000000..dd41f7287 --- /dev/null +++ b/recipes/guru/index.js @@ -0,0 +1 @@ +module.exports = Ferdium => Ferdium; diff --git a/recipes/guru/package.json b/recipes/guru/package.json new file mode 100644 index 000000000..fa1c01de4 --- /dev/null +++ b/recipes/guru/package.json @@ -0,0 +1,9 @@ +{ + "id": "guru", + "name": "guru.com", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://www.guru.com/pro/messages.aspx" + } +} diff --git a/recipes/guru/webview.js b/recipes/guru/webview.js new file mode 100644 index 000000000..4ffefa05c --- /dev/null +++ b/recipes/guru/webview.js @@ -0,0 +1,19 @@ +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +const _path = _interopRequireDefault(require('path')); + +module.exports = Ferdium => { + const getMessages = () => { + const directMessages = $( + '.module_btn.lonely_btn.white_btn.globalHeader__btn.accountDropdownBtn', + )?.textContent; + + Ferdium.setBadge(directMessages); + }; + + Ferdium.loop(getMessages); + + Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); +}; diff --git a/recipes/peopleperhour/icon.svg b/recipes/peopleperhour/icon.svg new file mode 100644 index 000000000..881abb894 --- /dev/null +++ b/recipes/peopleperhour/icon.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + diff --git a/recipes/peopleperhour/index.js b/recipes/peopleperhour/index.js new file mode 100644 index 000000000..dd41f7287 --- /dev/null +++ b/recipes/peopleperhour/index.js @@ -0,0 +1 @@ +module.exports = Ferdium => Ferdium; diff --git a/recipes/peopleperhour/package.json b/recipes/peopleperhour/package.json new file mode 100644 index 000000000..a08e8cbe8 --- /dev/null +++ b/recipes/peopleperhour/package.json @@ -0,0 +1,9 @@ +{ + "id": "peopleperhour", + "name": "People Per Hour", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://www.peopleperhour.com/notification/list" + } +} diff --git a/recipes/peopleperhour/webview.js b/recipes/peopleperhour/webview.js new file mode 100644 index 000000000..18ba3810f --- /dev/null +++ b/recipes/peopleperhour/webview.js @@ -0,0 +1,19 @@ +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +const _path = _interopRequireDefault(require('path')); + +module.exports = Ferdium => { + const getMessages = () => { + const directMessages = $( + '.notification-item.col-xs-12.clearfix.unread', + )?.length; + + Ferdium.setBadge(directMessages); + }; + + Ferdium.loop(getMessages); + + Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); +}; diff --git a/recipes/truelancer/icon.svg b/recipes/truelancer/icon.svg new file mode 100644 index 000000000..490ceb6bd --- /dev/null +++ b/recipes/truelancer/icon.svg @@ -0,0 +1,62 @@ + + + + diff --git a/recipes/truelancer/index.js b/recipes/truelancer/index.js new file mode 100644 index 000000000..dd41f7287 --- /dev/null +++ b/recipes/truelancer/index.js @@ -0,0 +1 @@ +module.exports = Ferdium => Ferdium; diff --git a/recipes/truelancer/package.json b/recipes/truelancer/package.json new file mode 100644 index 000000000..3968d91c5 --- /dev/null +++ b/recipes/truelancer/package.json @@ -0,0 +1,9 @@ +{ + "id": "truelancer", + "name": "Truelancer", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://www.truelancer.com/notifications?page=1" + } +} diff --git a/recipes/truelancer/webview.js b/recipes/truelancer/webview.js new file mode 100644 index 000000000..faba167c2 --- /dev/null +++ b/recipes/truelancer/webview.js @@ -0,0 +1,19 @@ +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +const _path = _interopRequireDefault(require('path')); + +module.exports = Ferdium => { + const getMessages = () => { + const directMessages = document.querySelectorAll( + '.MuiBox-root .mui-12z0wuy', + )?.length; + + Ferdium.setBadge(directMessages); + }; + + Ferdium.loop(getMessages); + + Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); +};