“Who ya gonna call?” “CODEBUSTERS”
No.
But the metaphor of Ghostbusters crossing the streams was inversely appropriate to a little bit of code action over the holidays (of which the actual action was nil).
But this was fun.
This nice tweet from John Johnston (who spawned the idea) reminded me of a WordPress plugin I had made
The WP Posted Today plugin is meant to offer a short code you can put on a site and it will list all previous posts on the current calendar day (this of course is useful if you actually still blog regularly) (cough) (cough).
Just for grins I checked the page where I use my own plugin. Yikes. Red Alert. It displayed all the ones for December 29 in years past, but the part where it should list how many there were was blank.
I dug into my own code… and found myself a bit lost. Crossed. I was not even sure where I got the sprintf functions (John’s original code?) that were aimed to be compatible if anyone every wanted a language translation (maybe, or it’s just that thing when people code things differently).
Taking the path of least resistance, I took out the code where I think the problem was occurring and did it a more simple, but brute force way.
And it worked.
So I updated the version on GitHub and felt at peace with the world. In the off chance someone stumbled into my little corner of code, they would find something that works (or should work).
And then (here comes a stream crossing) Michael Hanscom @djwudi — someone I don’t think I’ve ever communicated with — tweets that he had seen pretty much the same bug and offered a fix.
In looking at his post I saw the fix he made, and said– that’s better than mine! So I decided today to roll back my changes in place of Michael’s solution (but also keeping a modification I had made to remove extraneous calls when not needed for singular versus multiple results).
I noted the extra change he made in hos own version
Plus, I’ve made one other tweak to the plugin, so that it adds a link to the end of the excerpt to better handle “microblog” style entries that don’t have titles, so I still get to feel good about that part, as well. 🙂 My coding skills may be underdeveloped and rusty from lack of regular use, but they’re not entirely atrophied!
In this case, these microblog type entries (see Michael’s demo page) lack titles, so yes, a link is needed at the end of the post excerpt.
Yet I could see that regular posts (like on my site) did not need the extra link, and also, not everyone might want the arrow Michael likes.
I solved this cleverly by creating an additional shortcode parameter more which defaults to a blank string. In the shortcode function, we convert any attributes passed to variables with
extract(shortcode_atts( array( "month" => '', "day" => '', 'excerpt' => 1, 'more' => '' ), $atts ));
So on my site, where I just used the shortcode There are 23 posts previously published on January 1st
- 2022
- Daily Photos Round 15 Traditions and rituals are nothing without repetition. As in years before, a first task is a resetting of the daily photo project in flickr. This is something I have been at since 2008 (if you are doing the math, like an array, remember the first year is 0). I cite myself for the history, here […]
- 2021
- The Red Book Project I thought this was going to be a small digital cleanup project I could cross off my list over the holiday break. But like many tasks, when you pop open the hood (bonnet for those elsewhere), there ends up being more than you expected. There is a publication I wrote in (gasp) 1989 that I […]
- Kicking a Domain to the Curb I started my habit in 2005. Yes, I have accumulated more than a few domains (details in my domain interview). I can stop at anytime. Im fact, I am shucking one this month. I credit a colleague I’ve not crossed paths with in a long time, Steve Dembo (he still has his own http://www.teach42.com/ sadly […]
- Time For Daily Photos Today’s the day to reset the clock on what I find is my own response to Curly’s Law– keeping to a habit of trying to take photographs of something very day, and choosing that One photo to post to flickr as for that day. It means a few things, now just out of the YouTube […]
- 2019
- A Year Reflects Through the Lens The sound calendar flipping comes with it the rounds of The People That Still Blog writing their summaries of the flipped year and/or the hopes/promises of the year being flipped to. Without resorting to anyone but myself for analytics, I can link to 170 blog posts for 2018 (14.2 per month, and that 0.2 of […]
- 2018
- Organizing My Pile of Old Web Bones Archiving and digital legacy [ought] to be in the air. The bava has been at it; Jim has been cleaning up his pile pf past webs, like an abandoned Known and the OpenVA web site. He’s been writing about Archiving his Digital Past and the concept of an Archive of One’s Own. I’ve been harping […]
- Bumping by 1: match(/20[0-9][0-9]/36[5|6]/g).length (doing another year of daily photos) My first resolution shall be to never again trying using a regular expression in a blog post title. And my syntax for counting matches is a bit problematic. Later today I will add the 11th flickr album set to this collection In theory my lame regex should find all the album titles in the form […]
- 2016
- 2015: Year of the SPLOT I knew right away this tweet would, could, and should be used against me: Oh shit. Here come the year end summaries — Alan Levine (@cogdog) December 21, 2015 So I am going to be the first pot to call the kettle black. I’m doing a year-end summary. Of course its reasonable on the turning […]
- Another Year, Another 356 Photos It’s less than an hour away from 2016. It took a bit longer than I hoped to finalize my flickr album of daily photos from this year. This makes the eighth year in a row of a habit of taking photos each day and choosing one to be my “photo of the day” This goes […]
- 2014
- Still Looking Through the Lens cc licensed ( BY SA ) flickr photo shared by Alan Levine This is no list of career highlights for 2013, no roundup of top viewed blog posts, no prizes are being given, just another day the wind blows and rips a page of the calendar that falls on the floor. If I were to […]
- 2013
- The Ox: John GIFwistle In my late night Youtube wandering, among the suggested videos that popped up last night was, An Ox’s Tale, the full length documentary of The Who’s bass genius, John Entwistle. The guy was in an orbit of his own for what he accomplished, from building his first electric bass by hand, to the way he […]
- 2012 In Numbers Ah end of the year, start of the next. Reflecting backward / resoluting forward. Last year, I had several months of my Odyssey Road Stats to bring forth as a numerical summary. I was envious super impressed with Dean Shareski’s My Year in Numbers video – it totally was more watchable and fun then reading […]
- 2012
- Building the No English Words Translation Tool I’ve got an interest in beefing up my JavaScript tools in 2012- I’ve mildly dabbled on and off, but am far behind in the current state of the code. I started doing more trying to build more of the onboard interfaces for the StoryBox, mainly because I lacked the python chops to do so. But […]
- 2011/365: The Movie Following on Dean Shareski’s 1461 and counting, I was inspired to create a video from my own 2011/365 photos. In previous years, I used the easiest method for this, using the pummelvisoon site, but wanted to see if it could be easily done in my own tools. It took not long at all! Since I […]
- Word for 2012 It was while visiting Leslie last night that she shared a wonderful way to set up an approach to the new year, that she learned from Stephen Hurley (see his word for 2012). Rather than the usual concept of resolutions, which tend to be setups for failures by making one shot goals of things we […]
- 2011
- Cheese and Bacon Cheddar cheese is yellow and melts nicely to make sandwiches. Bacon has the ability to arouse the dead with its delicious smell and to drive Canadians bonkers. Desire is stacked in favor of the bacon, except– They’re under pressure from health nuts, vegans and pig lovers to eat soy food product. It takes guts to […]
- Accidental Timeline By sheer accident I stumbled across the google search results display that matches results to a timeline, here is a technology timeline This apparently lists results that have both your search keyword and a date. I cannot figure out how I got there, but if you take any standard results, say the big wide search […]
- 2010
- 365 Photos/Rewind/Connect/Again cc licensed flickr photo shared by cogdogblog Wow it has been so nice to be lazy, to be spending what feels like more time offline than online. All of the tech todos on my list for the holiday vacation remain undone (the list crumpled up and is burning in the wood stove now). The plan […]
- 2009
- Questions and Answers for Anything cc licensed flickr photo by Marcus Ramberg I’ve been seeing a number of my search results this year landing on sites like WikiAnswers and Yahoo Answers — these are useful setups using a wiki based model where anyone can post a question, and then any site visitor can answer. It’s a great approach. I mean, […]
- We Have the Tools, the Technology, to Make the Worlds First Bionic WikiPedia Among others, Lee Blackall is asking if WikiPedia should cost six million dollars in light of the budget details released by Jimmy Wales. After, all six million clams is a lot of moolah, more than most wikipedia authors/users likely have sitting in their piggy banks. I could not help a flashback to what that amount […]
- 2008
- Is it Spam if a Spammer Says It Isn’t Spam? Good golly, 2008 is not even 24 hours in the bag, and I am blogging about spammers. You can certainly see something I did not put on my resolution list (which, in fact, is another one of those zero item lists). Spotting spam sometimes takes some detection, but other times its a simple matter of: […]
- One Day One Photo “Mike” was one of three llamas I hiked with from Strawberry Llama Ranch for a New Years Day trek into Fossil Creek Canyon. Mike was the alpha of the three, so he mostly had to march in front, and spent a lot of time munching juniper, oak, and dried grass. These animals are amazing in […]
- 2005
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 23 posts previously published on January 1st
- 2022
- Daily Photos Round 15 Traditions and rituals are nothing without repetition. As in years before, a first task is a resetting of the daily photo project in flickr. This is something I have been at since 2008 (if you are doing the math, like an array, remember the first year is 0). I cite myself for the history, here […] ➡
- 2021
- The Red Book Project I thought this was going to be a small digital cleanup project I could cross off my list over the holiday break. But like many tasks, when you pop open the hood (bonnet for those elsewhere), there ends up being more than you expected. There is a publication I wrote in (gasp) 1989 that I […] ➡
- Kicking a Domain to the Curb I started my habit in 2005. Yes, I have accumulated more than a few domains (details in my domain interview). I can stop at anytime. Im fact, I am shucking one this month. I credit a colleague I’ve not crossed paths with in a long time, Steve Dembo (he still has his own http://www.teach42.com/ sadly […] ➡
- Time For Daily Photos Today’s the day to reset the clock on what I find is my own response to Curly’s Law– keeping to a habit of trying to take photographs of something very day, and choosing that One photo to post to flickr as for that day. It means a few things, now just out of the YouTube […] ➡
- 2019
- A Year Reflects Through the Lens The sound calendar flipping comes with it the rounds of The People That Still Blog writing their summaries of the flipped year and/or the hopes/promises of the year being flipped to. Without resorting to anyone but myself for analytics, I can link to 170 blog posts for 2018 (14.2 per month, and that 0.2 of […] ➡
- 2018
- Organizing My Pile of Old Web Bones Archiving and digital legacy [ought] to be in the air. The bava has been at it; Jim has been cleaning up his pile pf past webs, like an abandoned Known and the OpenVA web site. He’s been writing about Archiving his Digital Past and the concept of an Archive of One’s Own. I’ve been harping […] ➡
- Bumping by 1: match(/20[0-9][0-9]/36[5|6]/g).length (doing another year of daily photos) My first resolution shall be to never again trying using a regular expression in a blog post title. And my syntax for counting matches is a bit problematic. Later today I will add the 11th flickr album set to this collection In theory my lame regex should find all the album titles in the form […] ➡
- 2016
- 2015: Year of the SPLOT I knew right away this tweet would, could, and should be used against me: Oh shit. Here come the year end summaries — Alan Levine (@cogdog) December 21, 2015 So I am going to be the first pot to call the kettle black. I’m doing a year-end summary. Of course its reasonable on the turning […] ➡
- Another Year, Another 356 Photos It’s less than an hour away from 2016. It took a bit longer than I hoped to finalize my flickr album of daily photos from this year. This makes the eighth year in a row of a habit of taking photos each day and choosing one to be my “photo of the day” This goes […] ➡
- 2014
- Still Looking Through the Lens cc licensed ( BY SA ) flickr photo shared by Alan Levine This is no list of career highlights for 2013, no roundup of top viewed blog posts, no prizes are being given, just another day the wind blows and rips a page of the calendar that falls on the floor. If I were to […] ➡
- 2013
- The Ox: John GIFwistle In my late night Youtube wandering, among the suggested videos that popped up last night was, An Ox’s Tale, the full length documentary of The Who’s bass genius, John Entwistle. The guy was in an orbit of his own for what he accomplished, from building his first electric bass by hand, to the way he […] ➡
- 2012 In Numbers Ah end of the year, start of the next. Reflecting backward / resoluting forward. Last year, I had several months of my Odyssey Road Stats to bring forth as a numerical summary. I was envious super impressed with Dean Shareski’s My Year in Numbers video – it totally was more watchable and fun then reading […] ➡
- 2012
- Building the No English Words Translation Tool I’ve got an interest in beefing up my JavaScript tools in 2012- I’ve mildly dabbled on and off, but am far behind in the current state of the code. I started doing more trying to build more of the onboard interfaces for the StoryBox, mainly because I lacked the python chops to do so. But […] ➡
- 2011/365: The Movie Following on Dean Shareski’s 1461 and counting, I was inspired to create a video from my own 2011/365 photos. In previous years, I used the easiest method for this, using the pummelvisoon site, but wanted to see if it could be easily done in my own tools. It took not long at all! Since I […] ➡
- Word for 2012 It was while visiting Leslie last night that she shared a wonderful way to set up an approach to the new year, that she learned from Stephen Hurley (see his word for 2012). Rather than the usual concept of resolutions, which tend to be setups for failures by making one shot goals of things we […] ➡
- 2011
- Cheese and Bacon Cheddar cheese is yellow and melts nicely to make sandwiches. Bacon has the ability to arouse the dead with its delicious smell and to drive Canadians bonkers. Desire is stacked in favor of the bacon, except– They’re under pressure from health nuts, vegans and pig lovers to eat soy food product. It takes guts to […] ➡
- Accidental Timeline By sheer accident I stumbled across the google search results display that matches results to a timeline, here is a technology timeline This apparently lists results that have both your search keyword and a date. I cannot figure out how I got there, but if you take any standard results, say the big wide search […] ➡
- 2010
- 365 Photos/Rewind/Connect/Again cc licensed flickr photo shared by cogdogblog Wow it has been so nice to be lazy, to be spending what feels like more time offline than online. All of the tech todos on my list for the holiday vacation remain undone (the list crumpled up and is burning in the wood stove now). The plan […] ➡
- 2009
- Questions and Answers for Anything cc licensed flickr photo by Marcus Ramberg I’ve been seeing a number of my search results this year landing on sites like WikiAnswers and Yahoo Answers — these are useful setups using a wiki based model where anyone can post a question, and then any site visitor can answer. It’s a great approach. I mean, […] ➡
- We Have the Tools, the Technology, to Make the Worlds First Bionic WikiPedia Among others, Lee Blackall is asking if WikiPedia should cost six million dollars in light of the budget details released by Jimmy Wales. After, all six million clams is a lot of moolah, more than most wikipedia authors/users likely have sitting in their piggy banks. I could not help a flashback to what that amount […] ➡
- 2008
- Is it Spam if a Spammer Says It Isn’t Spam? Good golly, 2008 is not even 24 hours in the bag, and I am blogging about spammers. You can certainly see something I did not put on my resolution list (which, in fact, is another one of those zero item lists). Spotting spam sometimes takes some detection, but other times its a simple matter of: […] ➡
- One Day One Photo “Mike” was one of three llamas I hiked with from Strawberry Llama Ranch for a New Years Day trek into Fossil Creek Canyon. Mike was the alpha of the three, so he mostly had to march in front, and spent a lot of time munching juniper, oak, and dried grass. These animals are amazing in […] ➡
- 2005
to get the arrow codes he likes. This works because output for each found post looks like
// output post and link
$output .= '
' . get_the_title() . '';
// display excerpt if we want it
if ( $excerpt ) $output .= ' ' . get_the_excerpt();
// for microblog output where there might not be titles so add a link at end
// h/t https://www.michaelhanscom.com/eclecticism/2020/01/02/rss-feed-weirdness-and-php-debugging/
$output .= ' ' . $more . '';
So how is that for the odds of streams crossing on the same obscure bit of code? That’s the old fashioned kind of net serendipity that still happens.
Thanks Michael! Check out his 20 year old blog, he’s an “Enthusiastically Ambiverted Hopepunk” quite the tag line.
Featured Image: Edit of the Ghostbusters Cross Streams scene found in the Ghostbusters Fandom Wiki site which states “Community content is available under CC-BY-SA unless otherwise noted.” I replaced part of the background with a screenshot of the WP Posted Today PHP code.