From f1cf418f63687bf888ae51addbbc6748b642e4cb Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 27 Jul 2026 18:22:51 +0200 Subject: [PATCH] Add README and MIT license Co-Authored-By: Claude Sonnet 5 --- LICENSE | 21 +++++++++++++++++++++ README.md | 35 +++++++++++++++++++++++++++++++++++ book-links.user.js | 3 ++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e404389 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Alex Sirac + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a0a83a5 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# book-links + +A Violentmonkey userscript that shows where else you can get a book while you're browsing one — Anna's Archive and Waterstones — as a small floating widget in the corner of the page. + +## Install + +1. Install [Violentmonkey](https://violentmonkey.github.io/) (Chrome, Firefox, Edge). +2. Install the script from the raw file: [book-links.user.js](https://raw.githubusercontent.com/alexture/book-links/main/book-links.user.js) — Violentmonkey will prompt to install it. + +The script auto-updates itself from this repo (via `@updateURL`), so you don't need to reinstall it when it changes. + +## What it does + +On a book page on Bookshop.org, Amazon (`.fr`/`.com`), or Waterstones, it: + +1. Extracts the book's ISBN (from the URL or page content) and, as a fallback, title/author. +2. Checks whether the book is available on: + - **Waterstones** — skipped if you're already on Waterstones + - **Anna's Archive** +3. Shows a small widget in the bottom-right corner with a ✓ link if found, a ✗ if confirmed not found, or a `?` link if it couldn't be verified (e.g. JS-rendered search results) — closeable with the × button. + +## Supported sites + +- `bookshop.org/p/books/*` +- `waterstones.com/book/*` +- `amazon.fr` and `amazon.com` product pages (`/dp/*`) + +## Notes + +- Uses `GM_xmlhttpRequest` to query Anna's Archive and Waterstones directly from the page, bypassing CORS. +- Availability checks are best-effort text matching against search results, not an official API — the `?` state means "couldn't confirm either way, here's the search link." + +## License + +MIT — see [LICENSE](LICENSE). diff --git a/book-links.user.js b/book-links.user.js index 0610598..05258da 100644 --- a/book-links.user.js +++ b/book-links.user.js @@ -1,8 +1,9 @@ // ==UserScript== // @name Book Links // @namespace http://tampermonkey.net/ -// @version 1.0 +// @version 1.1 // @description Show Anna's Archive and Waterstones links when browsing books +// @license MIT // @match https://bookshop.org/p/books/* // @match https://www.waterstones.com/book/* // @match https://www.amazon.fr/dp/*