From 13b71aecef941c863a26b7b99dfa374e41af0299 Mon Sep 17 00:00:00 2001 From: "Tania R. Zúñiga" <25267490+TanZng@users.noreply.github.com> Date: Thu, 14 Oct 2021 12:25:04 -0500 Subject: 📖 Add Good Reads (#743) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- all.json | 9 +++++++++ recipes/good-reads/icon.svg | 10 ++++++++++ recipes/good-reads/index.js | 1 + recipes/good-reads/package.json | 9 +++++++++ recipes/good-reads/service.css | 1 + recipes/good-reads/webview.js | 21 +++++++++++++++++++++ 6 files changed, 51 insertions(+) create mode 100644 recipes/good-reads/icon.svg create mode 100644 recipes/good-reads/index.js create mode 100644 recipes/good-reads/package.json create mode 100644 recipes/good-reads/service.css create mode 100644 recipes/good-reads/webview.js diff --git a/all.json b/all.json index 9c11887..b63cbc7 100644 --- a/all.json +++ b/all.json @@ -531,6 +531,15 @@ "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/gmail/icon.svg" } }, + { + "featured": false, + "id": "good-reads", + "name": "Good Reads", + "version": "1.0.0", + "icons": { + "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/good-reads/icon.svg" + } + }, { "featured": false, "id": "google-contacts", diff --git a/recipes/good-reads/icon.svg b/recipes/good-reads/icon.svg new file mode 100644 index 0000000..f695d6a --- /dev/null +++ b/recipes/good-reads/icon.svg @@ -0,0 +1,10 @@ + + icon-svg + + + + \ No newline at end of file diff --git a/recipes/good-reads/index.js b/recipes/good-reads/index.js new file mode 100644 index 0000000..419c60d --- /dev/null +++ b/recipes/good-reads/index.js @@ -0,0 +1 @@ +module.exports = (Ferdi) => class GoodReads extends Ferdi {}; diff --git a/recipes/good-reads/package.json b/recipes/good-reads/package.json new file mode 100644 index 0000000..310da33 --- /dev/null +++ b/recipes/good-reads/package.json @@ -0,0 +1,9 @@ +{ + "id": "good-reads", + "name": "Good Reads", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://www.goodreads.com/" + } +} diff --git a/recipes/good-reads/service.css b/recipes/good-reads/service.css new file mode 100644 index 0000000..38dcab0 --- /dev/null +++ b/recipes/good-reads/service.css @@ -0,0 +1 @@ +/* Insert custom styles you want to insert here */ \ No newline at end of file diff --git a/recipes/good-reads/webview.js b/recipes/good-reads/webview.js new file mode 100644 index 0000000..338b634 --- /dev/null +++ b/recipes/good-reads/webview.js @@ -0,0 +1,21 @@ +var _path = _interopRequireDefault(require("path")); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +module.exports = (Ferdi) => { + const getMessages = () => { + const notificationBadge = document.querySelector( + ".siteHeader__topLevelItem--profileIcon .headerPersonalNav .modalTrigger .headerPersonalNav__icon .headerPersonalNav__flag" + ); + let notification = notificationBadge + ? Number.parseInt(notificationBadge.textContent) + : 0; + + Ferdi.setBadge(notification); + }; + Ferdi.loop(getMessages); + + Ferdi.injectCSS(_path.default.join(__dirname, "service.css")); +}; -- cgit v1.2.3-54-g00ecf