“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 January 13th

  • 2024
    • Happily SPLOTic Metaphors Sadly Robotic I was in conversation this week with the folks concocting an AI flavored DS106 making use of the remarkable monster spawned of Michael Branson Smith of a generated Dr Oblivion All I can say is try it. But there was a round of group fatigue, ennui, fill in another synonym towards AI. We are not […]
  • 2023
  • 2020
    • I Never Was an “EdTech Guy” Recently Dean Shareski, long time internet colleague, friend, and since I moved to near Moose Jaw, neighbor, blogged that I Don’t Think I’m an EdTech Guy Anymore. Scanning the comments on his post or the long thread of replies to the tweet thereof, there’s a whole boat full of “Me toos.” Not me. And not […]
  • 2016
  • 2013
    • Self Introduction for ds106 Students Just so my students who start ds106 starting tomorrow know who they are dealing with! There is still time to drop, ha ha.  Share this barking on social media
    • Poop2013: Imagine How Many Pastures We Could Fertilize The yup you yup agreement embodied in GIF form here is from here forward to the end of time (or til I get bored) is the iocn to represent the silliest of MOOC ideas published. The odor… Among the buffet of dining varieties of educational web sites, edudemic reminds me most of something as tasty […]
    • Building the ETMOOC Blog Hub (part 2) cc licensed ( BY NC SD ) flickr photo shared by epc In my last post, I quickly overviewed the wordpress customizations I did to set up the ETMOOC Blog Hub. Using the Feedwordpress plugin for a few feeds is easy to do, and it does a rather slick job of finding feeds from a […]
    • Building the ETMOOC Blog Hub (part 1) cc licensed ( BY ) flickr photo shared by agiledogs I’m really getting the hang of setting up these FeedWordPress powered syndication sites- I wrote a few days ago about using this approach to create a twitter archive site for the ETMOOC site. At the same time, and more over the last few days, I […]
  • 2010
    • No Linked Attribution: When the CC Item Vanishes? I always provide links back to the source as attribution for the flickr creative commons photos I use. Today I ran into the not so surprising case of wondering what to do, and what the ramifications for, if the original is no longer there? Here’s the case. A dark night in a web that knows […]
  • 2007
    • Faux Ocotillo Resurrected Faux Ocotillo Resurrectedavailable on flickr When I left Maricopa last April, my colleague David Weaver gave me this plant as a stand in for an Ocotillo (a project I supported for like 10 years). I am not a good plant caretaker, and with a little bit of in-attention, this plant lost most its leaves a […]
  • 2006
    • New Learning Technologies Buffet (Wiki Yum) Sometime before the end of December. my colleague Tom Foster at Chandler-Gilbert asked me to co-lead a workshop for Maricopa library staff. Tom has helped me a lot, so of course I said “yes”. Then last week, he reminded me we had a week to prepare for our session just completed. So what does one […]
    • Do I Smell More AJAX in My Flickr Photos? One of the joys of flickr is discovering new features the web elves have slipped in in there. The one I discovered likely has been there a long time… but I just noticed then when you are viewing an image that is part of a set, say one of my flower shots of a tulip […]
  • 2005
    • Build Your Own DeliciousFurlBagConnotea Marklet Maker I recently wrote of some JavaScript glue-ing I did to create a tool that allows my to take any web page in view, and submit it with one click to Furl, del.icio.us, Connotea, and our own Bag of URLs (see A Cup of Connotea: A New del.icio.us Flavor of Social Bookmarking (and now a 4 […]
    • Hey, That’s Us! (But are we in FL?) The January 2005 issue of Campus Technology has a nice two spread on my employer, the Maricopa Community Colleges. In “Who We Are”, our IT Vice Chancellor outlines some of the big numbers about our big system (which is impressive), our recent successful .980 billion dollar bond election, and puts some prods into some areas […]
    • Oh, those messy character encodings.. I recently wrote of some experiments to improved Feed2JS (see the updates fed to the site, bottom of the main page). Specifically, based on the request from a user in Germany, I attempted to change the output to encode content as UTF-8 using the new features on Magpie RSS 0.7. However, I have gotten an […]
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 January 13th

  • 2024
    • Happily SPLOTic Metaphors Sadly Robotic I was in conversation this week with the folks concocting an AI flavored DS106 making use of the remarkable monster spawned of Michael Branson Smith of a generated Dr Oblivion All I can say is try it. But there was a round of group fatigue, ennui, fill in another synonym towards AI. We are not […] &amp#x27A1;
  • 2023
  • 2020
    • I Never Was an “EdTech Guy” Recently Dean Shareski, long time internet colleague, friend, and since I moved to near Moose Jaw, neighbor, blogged that I Don’t Think I’m an EdTech Guy Anymore. Scanning the comments on his post or the long thread of replies to the tweet thereof, there’s a whole boat full of “Me toos.” Not me. And not […] &amp#x27A1;
  • 2016
  • 2013
    • Self Introduction for ds106 Students Just so my students who start ds106 starting tomorrow know who they are dealing with! There is still time to drop, ha ha.  Share this barking on social media &amp#x27A1;
    • Poop2013: Imagine How Many Pastures We Could Fertilize The yup you yup agreement embodied in GIF form here is from here forward to the end of time (or til I get bored) is the iocn to represent the silliest of MOOC ideas published. The odor… Among the buffet of dining varieties of educational web sites, edudemic reminds me most of something as tasty […] &amp#x27A1;
    • Building the ETMOOC Blog Hub (part 2) cc licensed ( BY NC SD ) flickr photo shared by epc In my last post, I quickly overviewed the wordpress customizations I did to set up the ETMOOC Blog Hub. Using the Feedwordpress plugin for a few feeds is easy to do, and it does a rather slick job of finding feeds from a […] &amp#x27A1;
    • Building the ETMOOC Blog Hub (part 1) cc licensed ( BY ) flickr photo shared by agiledogs I’m really getting the hang of setting up these FeedWordPress powered syndication sites- I wrote a few days ago about using this approach to create a twitter archive site for the ETMOOC site. At the same time, and more over the last few days, I […] &amp#x27A1;
  • 2010
    • No Linked Attribution: When the CC Item Vanishes? I always provide links back to the source as attribution for the flickr creative commons photos I use. Today I ran into the not so surprising case of wondering what to do, and what the ramifications for, if the original is no longer there? Here’s the case. A dark night in a web that knows […] &amp#x27A1;
  • 2007
    • Faux Ocotillo Resurrected Faux Ocotillo Resurrectedavailable on flickr When I left Maricopa last April, my colleague David Weaver gave me this plant as a stand in for an Ocotillo (a project I supported for like 10 years). I am not a good plant caretaker, and with a little bit of in-attention, this plant lost most its leaves a […] &amp#x27A1;
  • 2006
    • New Learning Technologies Buffet (Wiki Yum) Sometime before the end of December. my colleague Tom Foster at Chandler-Gilbert asked me to co-lead a workshop for Maricopa library staff. Tom has helped me a lot, so of course I said “yes”. Then last week, he reminded me we had a week to prepare for our session just completed. So what does one […] &amp#x27A1;
    • Do I Smell More AJAX in My Flickr Photos? One of the joys of flickr is discovering new features the web elves have slipped in in there. The one I discovered likely has been there a long time… but I just noticed then when you are viewing an image that is part of a set, say one of my flower shots of a tulip […] &amp#x27A1;
  • 2005
    • Build Your Own DeliciousFurlBagConnotea Marklet Maker I recently wrote of some JavaScript glue-ing I did to create a tool that allows my to take any web page in view, and submit it with one click to Furl, del.icio.us, Connotea, and our own Bag of URLs (see A Cup of Connotea: A New del.icio.us Flavor of Social Bookmarking (and now a 4 […] &amp#x27A1;
    • Hey, That’s Us! (But are we in FL?) The January 2005 issue of Campus Technology has a nice two spread on my employer, the Maricopa Community Colleges. In “Who We Are”, our IT Vice Chancellor outlines some of the big numbers about our big system (which is impressive), our recent successful .980 billion dollar bond election, and puts some prods into some areas […] &amp#x27A1;
    • Oh, those messy character encodings.. I recently wrote of some experiments to improved Feed2JS (see the updates fed to the site, bottom of the main page). Specifically, based on the request from a user in Germany, I attempted to change the output to encode content as UTF-8 using the new features on Magpie RSS 0.7. However, I have gotten an […] &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 *