“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.

Red arrow points to missing number where the page output reads "There are posts previously published on December 29th"

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.

https://twitter.com/djwudi/status/1212871226953101313

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 19 posts previously published on December 16th

  • 2024
    • Watching My Doctor Teach In a last 2024 spurt of Jim Groom #BlogOrDie spirit (hey, bava, where is THE post on that?) more of a small but interesting observation I had (gulp) a month or go on a visit to my doctor. I have to say as well how much I appreciate finding Dr B. While the Canada healthcare […]
  • 2022
    • This is how my internet works All the places are full of doom, gloom, apocalypse about the state of the bird site or the impending end of _____ at the hands of AI or just the regular invoking of internet as burning dumpsters. I do not deny that these foul things are happening nor is this head in the sand. It’s […]
  • 2016
    • Weighing Books and Body I do have a pile of things I have dreams of writing about, but my blog queue is not a FILO system. Tonight’s dinner was in front of the RSS Reader, where I was impressed reading Clint Lalonde’s post Of Bikes and Books with his efforts this year to bike ride more, lose weight,and read […]
  • 2014
    • She… and My Path in Technology I see writing here as a way of working out ideas, not issuing profound certainties. Beyond my assured hatcheting of grammar and spelling (hi Sandy), I learn as I share, where I am often (a) wrong, (b) blind or (c) wrong. Upon an insightful comment from Maha Bali I am rethinking the assertion on Over […]
    • What is this Klown Doing? Ok, here I go. I am writing this as a Post in my known site.  Do I have any other better content to use as a test case? Maybe I will include a dog photo? Does this fit with the phrase of eating one’s own dog food? Odd bug, I cannot get the cursor past the photo in […]
    • Over Easy How do you like your eggs? When eating out I’d never pull the attitude Jack Nicholson’s character sneered in Five Easy Pieces: For most of my life, I’ve been a sunny side up or scrambled egg eater. In the last few years, maybe with a lot more road travel, I’ve gotten more fond of eggs […]
  • 2013
    • In Open Courses Our Glasses Remain Proportionally Empty You don’t [usually] pay for an open course. You don’t depend on it for a grade. You have nothing at stake except your own interest in a topic. “Failure” and “dropout” are words without meaningful meaning here. But we cannot help ourselves, Not reaching the finish line is something we apologize for. We measure ourselves […]
  • 2012
    • The Faultless Feed (GIF) Train I spotted many a grain elevator in my cross country travels, but this one in Lawndale Illinois caught my attention the most, for the faint “Faultless Feed” on the side of the grain elevator, plus as a bonus it was right on Old Route 66. While snapping my photos, I saw the lights down the […]
  • 2011
    • Slice 005: Levels over the Top in Tasmania cc licensed ( BY ) flickr photo shared by cogdogblog This multi-day slice touches on my week in Tasmania, starting Dec 7, 2011. IN accordance to Scottlo’s usual open self flagellation over audio tools, I have to worn you portions of this are indecipherable dues to the android recorder app I used which seemed in […]
  • 2010
    • Nobody Blabberizes Like the Bava, NOBODY In lieu of not having much other material to post here, I could not let the pre ds106 fun pass with a little playing with the most useful, erduite, scholarly web 2.0 tool… or see it at http://blabberize.com/view/id/351885. Like Xtranormal, most of the stuff one creates with Blabberize is pure nutbar crazy (but fun), yet, […]
    • Cooking Spam Stories cc licensed flickr photo shared by roboppy No one (admits) liking spam, the electronic kind nor the meat food product… well there are fans of the latter, more than the former. Instead of just complaining I seek to make use of the stuff. For a while I was trying to pull bits out and tweet […]
  • 2009
    • Counting Your Way to the Trending Tweets Pop cc licensed flickr photo shared by davisayer There are some grand mysteries that are still un-resolved, Mr Owl… Over at the neatly named The Clever Sheep blog I came across Rodd Lucier’s eager idea YELP! to try and score a landing as a Twitter trending topic: Maybe it’s just the hundreds of teacher-learners I follow […]
  • 2008
    • Google Code 5 Now That is Technical Detail! by cogdogblog posted 16 Dec ’08, 7.08pm MST PST on flickr There was a slight leak in the computing cloud when I was just checking my email. I figured it would close quickly (and it did), but I was curious at the link provided offering technical details. Ah- that makes […]
  • 2007
    • iPhone Dead Zone Map: That Would be Zero Bars, AT&T Last week I was at an NMC Board meeting, hosted at a very special location in Cupertino, and was oh, so overwrought with jealousy as colleagues pawed, swashed, swooshed with their shiny new iPhones. And I would be among the cool kids– if were it not for the utterly ridiculous lock AT&T has on being […]
  • 2004
    • Sigh, No News From Phentermine Spammer Well it has been 3 days since I yelled out “Hey Phentermine Pusher: You Left Your Roach Prints in Our Spam Honey Pot” seeking this person to reach out by email, say hello, and claim their prowess. I even offered 100 clams to them just for taking credit. No response. I would think someone capable […]
    • A Cup of Connotea: A New del.icio.us Flavor of Social Bookmarking (and now a 4 in 1 bookmark tool) Every day’s glance at the not so old RSS reader brings new gems. Today the far seeing Stephen Downes shared a link to Connotea, very much a nice knock off of del.icio.us for bookmarking sites as well as papers. Connotea is a place to keep links to the articles you read and the websites you […]
    • Oops On That Billboard Found while trolling some of the graphic design gems over at Cameron Moll’s Authentic Boredom Billboard Backside Blunder Only pure coincidence could create a scenario like this. Posted along I-15 in Provo, Utah, this billboard stand demonstrates what happens when an advertiser fails to consider what might be posted on the back of his billboard: […]
  • 2003
    • Kotke on Metadata: “Metadazzle-Overfizzle” Although I miss the literary references, I do like the spin that Jason Kotke puts on meta-data: Nothing takes the fun and personality out of writing like metadata. As software developers, photographers, writers, and users struggle to organize creative work so that people can locate what they’re after, the work itself has necessarily been de-emphasized. […]
    • Quick! Get Use out of RSS before the Vultures Ruin It There are people who can look at a peaceful valley or serene mountain vista and only see how it can be exploited; they see only golf courses, shopping malls, and asphalt. Likewise, there are those that can only look at a useful communications technology and only rub their hands in glee trying to figure out […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 19 posts previously published on December 16th

  • 2024
    • Watching My Doctor Teach In a last 2024 spurt of Jim Groom #BlogOrDie spirit (hey, bava, where is THE post on that?) more of a small but interesting observation I had (gulp) a month or go on a visit to my doctor. I have to say as well how much I appreciate finding Dr B. While the Canada healthcare […] &amp#x27A1;
  • 2022
    • This is how my internet works All the places are full of doom, gloom, apocalypse about the state of the bird site or the impending end of _____ at the hands of AI or just the regular invoking of internet as burning dumpsters. I do not deny that these foul things are happening nor is this head in the sand. It’s […] &amp#x27A1;
  • 2016
    • Weighing Books and Body I do have a pile of things I have dreams of writing about, but my blog queue is not a FILO system. Tonight’s dinner was in front of the RSS Reader, where I was impressed reading Clint Lalonde’s post Of Bikes and Books with his efforts this year to bike ride more, lose weight,and read […] &amp#x27A1;
  • 2014
    • She… and My Path in Technology I see writing here as a way of working out ideas, not issuing profound certainties. Beyond my assured hatcheting of grammar and spelling (hi Sandy), I learn as I share, where I am often (a) wrong, (b) blind or (c) wrong. Upon an insightful comment from Maha Bali I am rethinking the assertion on Over […] &amp#x27A1;
    • What is this Klown Doing? Ok, here I go. I am writing this as a Post in my known site.  Do I have any other better content to use as a test case? Maybe I will include a dog photo? Does this fit with the phrase of eating one’s own dog food? Odd bug, I cannot get the cursor past the photo in […] &amp#x27A1;
    • Over Easy How do you like your eggs? When eating out I’d never pull the attitude Jack Nicholson’s character sneered in Five Easy Pieces: For most of my life, I’ve been a sunny side up or scrambled egg eater. In the last few years, maybe with a lot more road travel, I’ve gotten more fond of eggs […] &amp#x27A1;
  • 2013
    • In Open Courses Our Glasses Remain Proportionally Empty You don’t [usually] pay for an open course. You don’t depend on it for a grade. You have nothing at stake except your own interest in a topic. “Failure” and “dropout” are words without meaningful meaning here. But we cannot help ourselves, Not reaching the finish line is something we apologize for. We measure ourselves […] &amp#x27A1;
  • 2012
    • The Faultless Feed (GIF) Train I spotted many a grain elevator in my cross country travels, but this one in Lawndale Illinois caught my attention the most, for the faint “Faultless Feed” on the side of the grain elevator, plus as a bonus it was right on Old Route 66. While snapping my photos, I saw the lights down the […] &amp#x27A1;
  • 2011
    • Slice 005: Levels over the Top in Tasmania cc licensed ( BY ) flickr photo shared by cogdogblog This multi-day slice touches on my week in Tasmania, starting Dec 7, 2011. IN accordance to Scottlo’s usual open self flagellation over audio tools, I have to worn you portions of this are indecipherable dues to the android recorder app I used which seemed in […] &amp#x27A1;
  • 2010
    • Nobody Blabberizes Like the Bava, NOBODY In lieu of not having much other material to post here, I could not let the pre ds106 fun pass with a little playing with the most useful, erduite, scholarly web 2.0 tool… or see it at http://blabberize.com/view/id/351885. Like Xtranormal, most of the stuff one creates with Blabberize is pure nutbar crazy (but fun), yet, […] &amp#x27A1;
    • Cooking Spam Stories cc licensed flickr photo shared by roboppy No one (admits) liking spam, the electronic kind nor the meat food product… well there are fans of the latter, more than the former. Instead of just complaining I seek to make use of the stuff. For a while I was trying to pull bits out and tweet […] &amp#x27A1;
  • 2009
    • Counting Your Way to the Trending Tweets Pop cc licensed flickr photo shared by davisayer There are some grand mysteries that are still un-resolved, Mr Owl… Over at the neatly named The Clever Sheep blog I came across Rodd Lucier’s eager idea YELP! to try and score a landing as a Twitter trending topic: Maybe it’s just the hundreds of teacher-learners I follow […] &amp#x27A1;
  • 2008
    • Google Code 5 Now That is Technical Detail! by cogdogblog posted 16 Dec ’08, 7.08pm MST PST on flickr There was a slight leak in the computing cloud when I was just checking my email. I figured it would close quickly (and it did), but I was curious at the link provided offering technical details. Ah- that makes […] &amp#x27A1;
  • 2007
    • iPhone Dead Zone Map: That Would be Zero Bars, AT&T Last week I was at an NMC Board meeting, hosted at a very special location in Cupertino, and was oh, so overwrought with jealousy as colleagues pawed, swashed, swooshed with their shiny new iPhones. And I would be among the cool kids– if were it not for the utterly ridiculous lock AT&T has on being […] &amp#x27A1;
  • 2004
    • Sigh, No News From Phentermine Spammer Well it has been 3 days since I yelled out “Hey Phentermine Pusher: You Left Your Roach Prints in Our Spam Honey Pot” seeking this person to reach out by email, say hello, and claim their prowess. I even offered 100 clams to them just for taking credit. No response. I would think someone capable […] &amp#x27A1;
    • A Cup of Connotea: A New del.icio.us Flavor of Social Bookmarking (and now a 4 in 1 bookmark tool) Every day’s glance at the not so old RSS reader brings new gems. Today the far seeing Stephen Downes shared a link to Connotea, very much a nice knock off of del.icio.us for bookmarking sites as well as papers. Connotea is a place to keep links to the articles you read and the websites you […] &amp#x27A1;
    • Oops On That Billboard Found while trolling some of the graphic design gems over at Cameron Moll’s Authentic Boredom Billboard Backside Blunder Only pure coincidence could create a scenario like this. Posted along I-15 in Provo, Utah, this billboard stand demonstrates what happens when an advertiser fails to consider what might be posted on the back of his billboard: […] &amp#x27A1;
  • 2003
    • Kotke on Metadata: “Metadazzle-Overfizzle” Although I miss the literary references, I do like the spin that Jason Kotke puts on meta-data: Nothing takes the fun and personality out of writing like metadata. As software developers, photographers, writers, and users struggle to organize creative work so that people can locate what they’re after, the work itself has necessarily been de-emphasized. […] &amp#x27A1;
    • Quick! Get Use out of RSS before the Vultures Ruin It There are people who can look at a peaceful valley or serene mountain vista and only see how it can be exploited; they see only golf courses, shopping malls, and asphalt. Likewise, there are those that can only look at a useful communications technology and only rub their hands in glee trying to figure out […] &amp#x27A1;
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.

    If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
    Become a patron at Patreon!
    Profile Picture for CogDog The Blog
    An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

    Leave a Reply

    Your email address will not be published. Required fields are marked *