Monday, July 17, 2017

Finding broken Photobucket Images on your site

Hopefully this helps more than a few site admins, bloggers, etc. who are seeing this image (right) instead of their Photobucket photos.

As you may know, Photobucket suddenly decided to break 3rd party image hosting for everyone on earth, rendering images on blogs, forums, and numerous other sites useless (link to story).

If you don't want to pay $399 per year for an account upgrade...

Here is a quick and dirty way to find broken Photobucket images on your site -- if your site isn't too huge. This should work in Linux, Mac or Windows with Cygwin.

wget -l 1 -r --force-html  http://example.com
find . -type f -exec grep -iHl 'photobucket' {} \; > photobucket.txt

The file photobucket.txt will contain a list of URLs for you to look at. For example, on this site, I get this list:
 
./www.bot-thoughts.com/2009/index.html
./www.bot-thoughts.com/2009/09/index.html
./www.bot-thoughts.com/2009/07/index.html
./www.bot-thoughts.com/2009/12/index.html

This list of filenames correspond to URLs on the site.
 
How does it work? 

Use wget to download the webpages recursively (-r) on your site only (one level deep with -l 1). 

Then, find all the files with find and use grep to search for the string photobucket

When that string is found, print the name of the file, only ignoring case (-iHl) and stick the output in a text file.

Monday, July 10, 2017

Diagnosing Watches With Electronics

I've been fascinated by mechanical watches since I was a kid. Little machines on the wrist, marking out the passage of time with an unexpected level of accuracy, at least if the watch is in good shape.

To measure accuracy and diagnose issues, watchmakers use a watch timer which listens for and measures intervals between ticks. However, the tools are rather expensive for hobbyists, such as yours truly.

Fortunately, free or low-cost options like Watch-o-Scope ease the burden, but require a sensor and preamplifier. Here's my take on this fun little preamp project.