This github repo contains the tool's codebase and is made public as an example of my work. You can use the tool without cloning this repo by visiting it at (URL coming soon).
This tool is intended for Amazon Associates ("affiliates") with established websites.
For a variety of reasons, your site's Amazon.com product links may become outdated. When this happens, your visitors end up on 404 pages ("dog pages") instead of the product(s) you meant to show them. This tool helps you quickly locate those dead links.
This tool scans your article for Amazon product links. It extracts a product ID from each link and checks that the product ID is valid. This website does not store your credentials or anything about your site.
Unfortunately, not every product on Amazon is in the Amazon Product Advertising API. Valid links may be marked "invalid" by this tool if the product doesn't exist in the API. The tool also considers links to Amazon.com search results to be "invalid" even though they are perfectly acceptable to Amazon and your site's users. You should manually confirm any "invalid" results you get.
- Clone both this repo (the client) and the server repo
- Open a terminal window for each repo
- In server,
npm install
andnode app.js
- In client,
cd amazin-app
, thenyarn install
, and finallyyarn start
- In your browser go to
localhost:3001
From the server repo:
nightwatch frontend.js
runs integration tests. Requires client running (in another tab, navigate to client repo and use npm start
)
From the client repo:
yarn test
rebuilds snapshots and runs unit tests
yarn test-u
runs unit tests on existing snapshots
- In the
client
repo, useyarn run build
to create a folder calledbuild
- Copy the contents of
build
(ie: not the build folder but what's inside it) - Go into the
server
repo directory - Open the
public
folder - Delete all of the files inside public
- Paste the contents of build into public
- Push this change to GitHub
- Use
git push heroku-amazin master
to push these changes to Heroku - Use
heroku open
to open the app
Troubleshooting: If the heroku repo isn't hooked up (403 when trying to push to heroku), follow these steps:
- In Terminal,
heroku login
and follow the steps to log in - Still in Terminal, enter
heroku git:remote -a amazin-link-checker
- For clarity and to avoid confusion with other Heroku remotes, I renamed this one to heroku-amazin
git remote rename heroku heroku-amazin
- Now the push can be done with
git push heroku-amazin master
Make a pull request and I'll check it out!
I'm a Chicago-based web developer who thought it might be fun to automate the tedious process of hunting outdated Amazon links on my blog.