I am planning on doing something new, here. I am going to start writing a “week in review” post where I talk about something that I worked on over the past week and maybe provide some links and/or photos from the week. This is meant to be 50% brain dump and 50% “I hope this helps someone”.
Early this week, I was given the task of double-checking the output of an international website. The site was written in ColdFusion 8 and I inherited it when I entered the organization. It has a “local site” for a dozen different countries and there is a mechanism for determining which content is visible for which country. I changed this mechanism, with the goal of making it more efficient and maintainable. I believe I succeeded in that, but I was left with the task of making sure that the correct content was still displayed in the correct place. After all, there was a lot of legal disclosures to compare.
At first, I started looking at writing a script that would get each page, trim it, and show me the differences. The problem with that is that tools like Beyond Compare and WinMerge already exist. Why reinvent the wheel? I then started looking at writing a script to just get the versions of the sites so that I could compare them. I quickly remembered (or was reminded) that wget can do that for you.
I wrote a bash script to get all of the local versions of the site and save them to the local disk. I then started doing comparisons. That is when I realized something that stopped me cold. ColdFusion outputs spaces and line breaks in parts of the code that don’t output anything (like cfloop, cfif, etc.). Since I changed the way the content inclusion worked, it moved a lot of those spaces and line breaks.
In the end, I had to go from page to page, manually copying text into Beyond Compare and marking each page as checked. It was a good idea but not all good ideas work out in the end.
Useful and/or interesting stuff I found this week: