Automatic IMDb / Netflix / Amazon Movie Links
Published by Chris Coyier
A while back on my personal blog I made up a list of all post-apocalyptic movies. It is just a reference guide for myself to keep track of which ones I have seen and haven't seen, but the page could be handy for others that are also into the subgenre. To make the list actually useful, there needed to be some links to take action on the movies. I figured three would be good:
- Amazon: to buy the movie
- Netflix: to add it to your queue
- IMDB: to learn more about the movie
One way to add these links to each movie in the list would have been to go to those websites, find the movie, and copy and paste the link. But boy that's a lot of grunt work for dozens and dozens of movies. There must be a better way.
The formats are like this:
Notice the Amazon one has my Affiliate ID in there. Might as well eh?
- Loop through each row
- Find the movie title
- Construct the URLs based on the movie title
- Create the links
- Append the links to the last empty table row