“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 13 posts previously published on May 14th
- 2023
- Splotbox: A SPLOT for Shorts Don’t let people tease you for wearing jorts, they are just a useful pair of shorts, expanding the life of their predecessors. And they are also now supported by the SPLOTbox theme, not necessarily the greatest improvement to my wordpress theme stable, but worth doing. Especially because it came from a happy user of SPLOTbox, […]
- 2017
- Keyboard Blues I’m hard on my laptop keyboard. That photo is my 3 year old MacBook Pro. Gone are e-r-t-i-o-a-s-h-n plus the Shift key and space bar are showing fatigue. You will see similar patterns on my older 2009 one, and the one before that I managed to crack the shift key. Several people at the Creative […]
- 2014
- On The Cover Material for an eventual True Story of Open Sharing, my photo is on the cover of Beautiful Wreck a novel by Larissa Brown. In a bleak future built on virtual reality, Ginn is a romantic who yearns for something real. She designs environments for people who play at being Vikings. But when her project goes […]
- 2013
- Yet Another Flickr CC Attribution Helper Update cc licensed ( BY NC SA ) flickr photo shared by sn0wcrash I had to make another tiny update to my flickr cc attribution helper script, more or less fixing my own goofs. The thing that was happening was the attribution was not appearing on your own photos (if you were logged into flickr), but […]
- 2011
- Story a Day May #13: Vcasmo Vcasmo is one of the 50+ Web 2.0 Ways to Tell a Story– it offers a platform to synchronize powerpoint/presentations to video. A typical use is to have video of a speaker linked to their slides, and it works elegantly there. I decided to tale a video I shot of Bryan Alexander at his house […]
- 2010
- Broken Solar Dreams cc licensed flickr photo shared by Swiss Bones Arizona is a state bombarded by a free source of untapped energy. Our electric companies have been offering incentives in the forms of rebates and tax credits. it’s not out of the goodness of their heart or their long term vision on the future of energy- it […]
- Bitten By a Card Shark modified from cc licensed flickr photo shared by pfala Sneaky. Damn sneaky. I got a nice $100 Visa gift card for my birthday last month.( I am not looking you in the mouth, Gift Horse). These look like credit card numbers, have numbers like credit cards. But there is is something tricky there- it’s nearly […]
- Road Wore-ier cc licensed flickr photo shared by Punchup I got to Austin airport ridiculously early this morning mainly because all I want to do is to get home, which I have not seen since April 28. I hope I remember where it is, much less, where my car is at the Phoenix airport (much less if I remember […]
- 2008
- 50 Ways @ Maricopa My second presentation yesterday for the Maricopa Teaching & Learning with Technology Conference was my favorite gig these days, the 50 Web 2.0 Ways to Tell a Story — which, as the audience learned, is actually hovering at ter Magic Heinz Number of 57 (well technically today 56, as toufee, one of the video editing […]
- Being There @ Maricopa Wow, what a great day it was yesterday to be back at my old stomping grounds but this time as an invited speaker for the Maricopa Teaching & Learning with Technology Conference which has become a great regional event, as they had attendees from Arizona State University, Coconino Community College, I heard even people came […]
- 2005
- Feedmarker Added to Site Submission Multitool I guess the world needs a few more sites to post and share web site bookmarks. The newest flavor that came our way from a reader is Feedmarker, which is the newest blade in my Web Site Submission Multitool bringing the total here to 13. Also, someone asked about adding Wists, the site tool that […]
- 2004
- New Tool BlogPulse (and how to GET what they POST) Somewhere in the aggregator today came a pointer to a new blog search tool, BlogPulse BlogPulse is an “automated trend discovery system for blogs. Blogs, a term that is short for weblogs, represent the fastest-growing medium of personal publishing and the newest method of individual expression and opinion on the Internet. BlogPulse applies machine-learning and […]
- 2003
- RSS 2 JS Code and Demo LAST update Okay, this should do it for a while. D’Arcy Norman suggested adding an output option to allow insertion of item date to the list. While in the code, I also made it possible to have an option on the channel display to list the title only (as well as title and description of channel, or […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 13 posts previously published on May 14th
- 2023
- Splotbox: A SPLOT for Shorts Don’t let people tease you for wearing jorts, they are just a useful pair of shorts, expanding the life of their predecessors. And they are also now supported by the SPLOTbox theme, not necessarily the greatest improvement to my wordpress theme stable, but worth doing. Especially because it came from a happy user of SPLOTbox, […] ➡
- 2017
- Keyboard Blues I’m hard on my laptop keyboard. That photo is my 3 year old MacBook Pro. Gone are e-r-t-i-o-a-s-h-n plus the Shift key and space bar are showing fatigue. You will see similar patterns on my older 2009 one, and the one before that I managed to crack the shift key. Several people at the Creative […] ➡
- 2014
- On The Cover Material for an eventual True Story of Open Sharing, my photo is on the cover of Beautiful Wreck a novel by Larissa Brown. In a bleak future built on virtual reality, Ginn is a romantic who yearns for something real. She designs environments for people who play at being Vikings. But when her project goes […] ➡
- 2013
- Yet Another Flickr CC Attribution Helper Update cc licensed ( BY NC SA ) flickr photo shared by sn0wcrash I had to make another tiny update to my flickr cc attribution helper script, more or less fixing my own goofs. The thing that was happening was the attribution was not appearing on your own photos (if you were logged into flickr), but […] ➡
- 2011
- Story a Day May #13: Vcasmo Vcasmo is one of the 50+ Web 2.0 Ways to Tell a Story– it offers a platform to synchronize powerpoint/presentations to video. A typical use is to have video of a speaker linked to their slides, and it works elegantly there. I decided to tale a video I shot of Bryan Alexander at his house […] ➡
- 2010
- Broken Solar Dreams cc licensed flickr photo shared by Swiss Bones Arizona is a state bombarded by a free source of untapped energy. Our electric companies have been offering incentives in the forms of rebates and tax credits. it’s not out of the goodness of their heart or their long term vision on the future of energy- it […] ➡
- Bitten By a Card Shark modified from cc licensed flickr photo shared by pfala Sneaky. Damn sneaky. I got a nice $100 Visa gift card for my birthday last month.( I am not looking you in the mouth, Gift Horse). These look like credit card numbers, have numbers like credit cards. But there is is something tricky there- it’s nearly […] ➡
- Road Wore-ier cc licensed flickr photo shared by Punchup I got to Austin airport ridiculously early this morning mainly because all I want to do is to get home, which I have not seen since April 28. I hope I remember where it is, much less, where my car is at the Phoenix airport (much less if I remember […] ➡
- 2008
- 50 Ways @ Maricopa My second presentation yesterday for the Maricopa Teaching & Learning with Technology Conference was my favorite gig these days, the 50 Web 2.0 Ways to Tell a Story — which, as the audience learned, is actually hovering at ter Magic Heinz Number of 57 (well technically today 56, as toufee, one of the video editing […] ➡
- Being There @ Maricopa Wow, what a great day it was yesterday to be back at my old stomping grounds but this time as an invited speaker for the Maricopa Teaching & Learning with Technology Conference which has become a great regional event, as they had attendees from Arizona State University, Coconino Community College, I heard even people came […] ➡
- 2005
- Feedmarker Added to Site Submission Multitool I guess the world needs a few more sites to post and share web site bookmarks. The newest flavor that came our way from a reader is Feedmarker, which is the newest blade in my Web Site Submission Multitool bringing the total here to 13. Also, someone asked about adding Wists, the site tool that […] ➡
- 2004
- New Tool BlogPulse (and how to GET what they POST) Somewhere in the aggregator today came a pointer to a new blog search tool, BlogPulse BlogPulse is an “automated trend discovery system for blogs. Blogs, a term that is short for weblogs, represent the fastest-growing medium of personal publishing and the newest method of individual expression and opinion on the Internet. BlogPulse applies machine-learning and […] ➡
- 2003
- RSS 2 JS Code and Demo LAST update Okay, this should do it for a while. D’Arcy Norman suggested adding an output option to allow insertion of item date to the list. While in the code, I also made it possible to have an option on the channel display to list the title only (as well as title and description of channel, or […] ➡
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.