“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 15 posts previously published on August 3rd

  • 2021
    • Links for Grinnell As my OEG colleagues are finding out, if you invite me to your webinar, I will not arrive with a slidedeck, but instead… links. I’m excited tomorrow to visit the Grinnell College’s online workshop A Home on the Web at the generous invitation of Mo Pelzel, one of those amazing connections again (and again) would […]
  • 2017
    • Season of The DS106 For no real or sane reason, was moved to do a cover version of Donovan’s Season of the Witch in my own variation as homage to DS106, which like a witch, cannot be killed. I play it differently than the original that’s what makes a cover version and not a copy. Just two chords, with […]
  • 2015
    • The Stuff You Think The Internet Will Find Funny… They Don’t Internet, you so fickle. Without much thought, you ca share something frivolous and people are all over it. You’re on fire. You get an idea in your head you think will get spread, and it falls like a lead rock on Jupiter. I’ve only marginally followed the story, but seeing Brett Gaylor’s tweet Robot hitch […]
    • Tweeting the #UdGAgora I have no insight to the future of twitter as a company that rumbles around the conjecture, business, and tech gazing blogs. Tech is always a moving target. Below are some thoughts and even charts and graphs about our use of twitter for the UdGAgora project, focussing for now on the use with our two […]
  • 2014
    • The Last Narrator This blog has 4097 posts since April 2003. My flickr photos includes 38,443 photos since March 2004. These are not numbers I call up to brag about (but please, tell me about about your 30,000th twitter follower). On a more recurring basis, I have noticed how often I use both of them, especially an ability […]
  • 2013
    • Where the Sasquatch Dancing Man Got His Moves If you have not seen the 2009 video at the Sasquatch concert where one dude got a whole crowd going: What the handheld video left out was a just before he started gyrating, he was got his moves from the Bava This is a few days late for the ds106 Month of GIF mania suggested […]
  • 2009
    • Talkin’ Bout Open I hope you enjoy this teaser for my presentation next week at the Open Education Conference: I could not help selecting the D’Arcy Norman Bigger Than Life glare for the freeze frame! These quotes from colleagues near and far were taken from the 34 longer interviews I collected for Amazing Stories of Openness, and the […]
    • New! Improved! With Extra Sheen! Flickr CC Attribution Helper cc licensed flickr photo shared by jamelah Mmm, sliced bread! So far maybe 140 people have installed my Flickr Creative Commons Attribution Helper– a GreaseMonkey script for Firefox. I use the sucker almost every day. It takes what used to be about a 5 click, 4 copy/paste operation to give me, in one motion, the […]
  • 2008
    • More Moo Goodness More Moo Goodness by cogdogblog posted 2 Aug ’08, 6.19pm MDT PST on flickr My moo note cards arrived today! I got a set of 16 cards with photos from my journeys to Australia. Yep, got more moo card goodies– my set of 16 notecards came today; I made a set of selected photos from […]
  • 2007
    • Heart Minnesota Heart Minnesota posted 3 Aug ’07, 9.27am MDT PST on flickr In light of the bridge collapse in Minneapolis and honoring people affected by this, today I am wearing my Stone Arch Festival t-shirt from our fabulous vacation there in June. Even for me, just one trip over that I35W bridge brings a shudder- I […]
  • 2005
    • Smell of Spam in the Morning A conversation overheard in my inbox as Thuunderbird chomped through the latest flux of meaningful email: Filters: “Smell that?… Do you smell that?” InBox: “What.” Filters: “Spam, son. Nothing else in the world smells like that… I love the smell of spam in the morning… Ya know, that gasoline smell… It smells like… victory.” Just […]
    • FeedDigest Is Mixing It Up I only spent 15 minutes at FeedDigest “Making Your Feeds Fabulous” but its got a whole lot of “oompf” potential if you are trying to do more with using multiple feed sources. More or less, you create a “digest” that you can then mix in a few RSS feeds, and Feed Digest provides a whole […]
    • Piling On EduBlogs I’m trying to give James a hand at bumping up the number of new sites at Edublogs.org by a factor of 10. I emailed a message to our distribution list for our Ocotillo Online Learning Group letting them new this was available. I’ve heard more people talk about, or actually try blogging in all of […]
  • 2004
    • “This A’int No Blogging” Part 2: Echo Blogging or Connecting As hoped, I already got some bark backs on “This A’int No Blogging” Part 1: If a Blog Falls in the Woods…. And as rightfully pointed out, comments are not all there is to being part of the blogging community- see the well thought comments just made by Stephen Downes — noting the pitfalls of […]
    • “This A’int No Blogging” Part 1: If a Blog Falls in the Woods… I am going to write something in this first of two posts that I bet (and hope) a lot of people will disagree with. I want that. I want to hear your dissent. That is what this stuff is about. Here it is, I make my own artificial distinction between publishing a weblog and the […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 15 posts previously published on August 3rd

  • 2021
    • Links for Grinnell As my OEG colleagues are finding out, if you invite me to your webinar, I will not arrive with a slidedeck, but instead… links. I’m excited tomorrow to visit the Grinnell College’s online workshop A Home on the Web at the generous invitation of Mo Pelzel, one of those amazing connections again (and again) would […] &amp#x27A1;
  • 2017
    • Season of The DS106 For no real or sane reason, was moved to do a cover version of Donovan’s Season of the Witch in my own variation as homage to DS106, which like a witch, cannot be killed. I play it differently than the original that’s what makes a cover version and not a copy. Just two chords, with […] &amp#x27A1;
  • 2015
    • The Stuff You Think The Internet Will Find Funny… They Don’t Internet, you so fickle. Without much thought, you ca share something frivolous and people are all over it. You’re on fire. You get an idea in your head you think will get spread, and it falls like a lead rock on Jupiter. I’ve only marginally followed the story, but seeing Brett Gaylor’s tweet Robot hitch […] &amp#x27A1;
    • Tweeting the #UdGAgora I have no insight to the future of twitter as a company that rumbles around the conjecture, business, and tech gazing blogs. Tech is always a moving target. Below are some thoughts and even charts and graphs about our use of twitter for the UdGAgora project, focussing for now on the use with our two […] &amp#x27A1;
  • 2014
    • The Last Narrator This blog has 4097 posts since April 2003. My flickr photos includes 38,443 photos since March 2004. These are not numbers I call up to brag about (but please, tell me about about your 30,000th twitter follower). On a more recurring basis, I have noticed how often I use both of them, especially an ability […] &amp#x27A1;
  • 2013
    • Where the Sasquatch Dancing Man Got His Moves If you have not seen the 2009 video at the Sasquatch concert where one dude got a whole crowd going: What the handheld video left out was a just before he started gyrating, he was got his moves from the Bava This is a few days late for the ds106 Month of GIF mania suggested […] &amp#x27A1;
  • 2009
    • Talkin’ Bout Open I hope you enjoy this teaser for my presentation next week at the Open Education Conference: I could not help selecting the D’Arcy Norman Bigger Than Life glare for the freeze frame! These quotes from colleagues near and far were taken from the 34 longer interviews I collected for Amazing Stories of Openness, and the […] &amp#x27A1;
    • New! Improved! With Extra Sheen! Flickr CC Attribution Helper cc licensed flickr photo shared by jamelah Mmm, sliced bread! So far maybe 140 people have installed my Flickr Creative Commons Attribution Helper– a GreaseMonkey script for Firefox. I use the sucker almost every day. It takes what used to be about a 5 click, 4 copy/paste operation to give me, in one motion, the […] &amp#x27A1;
  • 2008
    • More Moo Goodness More Moo Goodness by cogdogblog posted 2 Aug ’08, 6.19pm MDT PST on flickr My moo note cards arrived today! I got a set of 16 cards with photos from my journeys to Australia. Yep, got more moo card goodies– my set of 16 notecards came today; I made a set of selected photos from […] &amp#x27A1;
  • 2007
    • Heart Minnesota Heart Minnesota posted 3 Aug ’07, 9.27am MDT PST on flickr In light of the bridge collapse in Minneapolis and honoring people affected by this, today I am wearing my Stone Arch Festival t-shirt from our fabulous vacation there in June. Even for me, just one trip over that I35W bridge brings a shudder- I […] &amp#x27A1;
  • 2005
    • Smell of Spam in the Morning A conversation overheard in my inbox as Thuunderbird chomped through the latest flux of meaningful email: Filters: “Smell that?… Do you smell that?” InBox: “What.” Filters: “Spam, son. Nothing else in the world smells like that… I love the smell of spam in the morning… Ya know, that gasoline smell… It smells like… victory.” Just […] &amp#x27A1;
    • FeedDigest Is Mixing It Up I only spent 15 minutes at FeedDigest “Making Your Feeds Fabulous” but its got a whole lot of “oompf” potential if you are trying to do more with using multiple feed sources. More or less, you create a “digest” that you can then mix in a few RSS feeds, and Feed Digest provides a whole […] &amp#x27A1;
    • Piling On EduBlogs I’m trying to give James a hand at bumping up the number of new sites at Edublogs.org by a factor of 10. I emailed a message to our distribution list for our Ocotillo Online Learning Group letting them new this was available. I’ve heard more people talk about, or actually try blogging in all of […] &amp#x27A1;
  • 2004
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.

    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 *