Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiagob/convert-affiliate-links
https://github.com/tiagob/convert-affiliate-links
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tiagob/convert-affiliate-links
- Owner: tiagob
- License: mit
- Created: 2020-07-24T23:32:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T04:45:45.000Z (almost 2 years ago)
- Last Synced: 2024-12-09T22:32:56.560Z (27 days ago)
- Language: JavaScript
- Size: 90.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convert affiliate links
Script to convert Amazon to [Bookshop.org](https://bookshop.org/) affiliate links.
Takes a file with text like:
```
href="https://www.amazon.com/gp/product/[ISBN]/..."
```And replaces it with:
```
href="https://bookshop.org/a/[YOUR AFFILIATE ID]/[UPC]"
```## Install
```bash
yarn global add convert-affiliate-links
```or
```
npm install -g convert-affiliate-links
```## Example usage
### Amazon to Bookshop
```bash
convert-affiliate-links -r ~/word_press_export.xml -w word_press_import.xml -a 12345
```### Bookshop to Amazon
```bash
convert-affiliate-links -r ~/word_press_export.xml -w word_press_import.xml -c 12345 -s 12345 -p 12345
```## Help
```bash
% convert-affiliate-links -h
yarn run v1.22.4
$ tsc && node ./build/src/index.js --help
Usage: convert-affiliate-links [options]Options:
-V, --version output the version number
-r, --read-path
-w, --write-path
-h, --help display help for command
✨ Done in 1.58s.
```## How?
Uses https://www.isbn.org for ISBN to UPC conversion.