amazon link update requirement...

Amazon changed their servers, requiring an update of amazon ads through several domains and nearly 18,000 html pages. 

 As part of our continuing effort to improve the Associates program's products and services, 
we are making some changes to our technology platform.  This platform change will require you 
to replace some older product links, banners, and widgets you currently have hosted on your website 
as they will no longer be supported after July 31, 2015.  Text links are not impacted by this deprecation.

Action Required

We ask that you replace or update the impacted ad units prior to July 31, 2015. The links require the 
following update that can be facilitated through your CMS (content management system).  You may make these 
replacements at whatever scale you are comfortable with.

 - Find and replace ws.##FIX## with ws-na.## inactive ##
 - Find and replace rcm.##FIX## with rcm-na.## inactive ##



So, I tested a few commands to find those strings... then come up with the one line perl command to find and replace in line... but then I had to go through seven domains and nearly 18,000 pages... so I decided to use find and xargs. The following sequence of commands updated the pages. I wonder how long would it have taken to use a GUI tool to edit all of the pages on a server? Or to ftp the html pages to a PC and edit and then ftp them back. Using vi and the command line tools managing a website isn't hard. I suppose with a MySQL database a SQL statement could have been generated to update web pages. I have one domain with WordPress configured, I will try that some day and see... but for now... two commands updated the server.
quick test to scope the 1st name change: find . -type f -name '*.html' | xargs grep rcm.##FIX## many files

the command to replace the 1st server names:

find . -type f -name '*.html' | xargs perl -pi -e 's$//rcm.##FIX##$//rcm-na.## inactive ##$g'

quick test to scope the 2nd name change: find . -type f -name '*.html' | xargs grep ws.##FIX## many files

the command to replace the 2nd server names:

find . -type f -name '*.html' | xargs perl -pi -e 's$//ws.##FIX##$//ws-na.## inactive ##$g'

the command could have been executed without xargs as follows: find . -type f -name '*.html' -exec perl -pi -e 's$//ws.##FIX##$//ws-na.## inactive ##$g' {} \; Note: always test commands like this at the bottom of a subdirectory in case you have a syntax error so you don't wipe out your website and learn about the wayback machine like I did... or if you have a backup system how to do restores. I no longer advertise or sell amazon products on my domains - amsoil and my books are the only thing you'll find.


Simply Linux: Basics Linux Tackles Microsoft Using BASH on Windows 10
Practical Suggestions for Microsoft Windows
 Full Size Jeep Buyer's Guide
12 hour Video Course by john:
The Art of Linux System Administration
published by O'Reilly Media
Study Guide for the LPIC-2 Certification Exams
search for:
on the internet, or:
JohnMeister.com-fotos
LinuxMeister-Linux
BibleTech- Bible overview

overview of mankind's history
Biblical history:
"Promises and Prophets"

Wagoneers

FULL SIZE JEEPS

JeepMeister
"Jeep is America's
only real sports car."
-Enzo Ferrari


MeisterTech
Diesels +

One Page Overview of Linux Commands

click for an image of the 5 essential Linux commands

An Intro to Linux
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983
purchase AMSOIL
at Midway Auto on SR9 in Snohomish,
or at Northland Diesel in Bellingham, WA


SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)