Photo Corners

A   S C R A P B O O K   O F   S O L U T I O N S   F O R   T H E   P H O T O G R A P H E R

Enhancing the enjoyment of taking pictures with news that matters, features that entertain and images that delight. Published frequently.

Site Tweak: Expanded Editorial Counts Share This on LinkedIn   Share This on Google   Tweet This   Forward This

1 April 2019

When we wrote our Keyboard Maestro macro to count the stories in each category that we've published this month, we realized it had a shortcoming. It only reported the current month.

Say we waited until April 1 to get our March totals. We'd get April totals, instead. We'd have to count March by hand, like we did in the old days.

That hasn't happened to us yet, but we live in fear of it.

More importantly, the count derived from the "Published frequently" link on the home page has the same issue. Which means you can't get any editorial counts for anything but the current month either.

We have a hunch we'll continue to optimize the code.

So we decided to revise our Perl CGI to accept any published month and year from a simple form. The link to that form appears only on our Archive page where it says "Published frequently."

We thought that was cute: the link on the current home page with this month's stories on top gets data for the current month but the link on the Archive page lets you pick any month you want. Same link, different options.

Historical counts don't include the calendar and may not match our published results (the archive story that leads each month) because we do reassign ambiguous stories to categories the count couldn't. So something counted as a Feature that dealt with a particular event might end up as an Editor's Note.

It's the difference between machine sorting and intelligent sorting. The code can't read, after all.

For your convenience the form does use pulldown menus for both the month and year. But the code checks for out-of-range entries. So if you try to enter anything before December 2012 when we started publishing or beyond this month (where no one has been yet), it will politely reset the form without making a fuss.

We have a hunch we'll continue to optimize the code. But it seems to be doing the job right now, so we thought we'd tell you about it.

BackBack to Photo Corners