“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 October 18th

  • 2022
    • Lists of Web Sites and Revisiting the Island of Lost Storytelling Tools Do you know one of the oldest professions on the web? Not that one — heads out of gutters– please! But then again, revel in the curioustity holes that Wikipedia can open when I looked for that link… No, it is making web pages that are list of other web sites. Educators love this dearly, […]
  • 2021
    • Flipping the Setup: Taking a Podcast on the Road It seems like you can hardly spit these days without hitting a podcast. Spit at me, I am at it too! What you can do these days (like having a web based multi-source recording studio, like Zencastr is far ahead of what I was doing in 2006 with a tiny pocket sized digital recorder. I’ve […]
    • H5Ping With H5P, in a way, Syndication People have pretty much lost track of the syndication bus, small things joined in any way, and talking about things like RSS is a sure fire way for some kid to make fun of grandpa on TikTok. It still runs strong in me. Heck I just tested putting a Hypothes.is RSS feed into Feed2JS. It […]
  • 2019
    • Explaining the Cost of Insulin Borders on Insanity This month marks the 49th year since I was diagnosed as a Type 1 diabetic. Back in 1970 they actually hospitalized me 10 days to stabilize my sugar levels and to educate me and my parents about this new routine of daily injections. I do not remember my parents worrying about the cost of medication. […]
  • 2016
    • Explode Yourself As an alternative to the myopic sounds of news on the radio these days, I’m turning up the amount of podcast listening when I have more than 30 driving. One show I have been really enjoying is Song Exploder: Song Exploder is a podcast where musicians take apart their songs, and piece by piece, tell […]
  • 2011
    • How The Heck Did I Get to Philly? Things are getting crazy here in the underground. Perhaps it is dark matter or super neutrinos, but I have somehow been transported through some sort of space/time dimension. Let’s recap what’s been happening. When I last reported, I was sticking to the instructions/clues provided by @0pcode49 and following the railroad tracks. Spooked by the scary […]
    • Bava Bava The Dancing Animated GIF Machine This was purely an academic exercuse (that typo is intentional) in learning how to import video into Photoshop and use animation and masks to create animated GIFs. I just used a random video I had laying around in the Storybox. First turn on the music… Get up out of your chair and dance along: FYI […]
  • 2008
    • Tilt-Shifting Fun Telegraph Hill Tilt Shift by cogdogblog posted 19 Oct ’08, 12.10am MDT PST on flickr Inspired by a link from kotke to the Fenway Park "Model", I experimented with the Fake Model method. Essentially it is a PhotoShop play of careful gradient selection and lens blur to create effects that convert real photos to images […]
  • 2005
    • Me 2.0 Faster then a speeding meme, more hot that the surface of the sun, all one needs now for a “sexy” technology name is to tack on a “2.0”. Already tired and expired is putting an “i” in front of every noun, even more tired/ more expired is putting the “e” in front of everything. Submitted […]
    • Running / Blogging / Running I have an unwritten internal filter on the range of topics blogged here. For a personal venture I have taken up, to run a half marathon in January, I decided to set up as its own blog, on my own domain. So I won’t be really writing about it here- you can see the full […]
    • What’s In an URL? There are big URLs, little URLs, long convoluted database generated URLs. I’ve always leaned a bit towards the side of the fence where web site addresses that indicate what their content points to is a bit more useful than long meaningless ones. But it may not even matter. I was struck by this today visiting […]
  • 2004
    • Denver Bound In a few clicks, I’m off to the airport for Denver heading there for the EDUCAUSE 2004 Conference Extravaganza. With good wireless connectivity, I hope to blog what I can. Tomorrow Brian and I will be rounding up some objects in our pre-conference seminar, “Decentralization of Learning Resources: Syndicating Learning Objects Using RSS, TrackBack, and […]
    • Why Is Blogger.com Hiding the RSS? Let it Out! Under the powerful Google umbrella, Blogger.com is a huge player in the blog-verse offering totally free, hosted blogs, and they are now even looking less cheesy than a few years back. But for being the heavy weight, they are keeping RSS Feeds a hidden gem only known to those that care to put on their […]
  • 2003
    • Bloggin’ da League Conf Well here I am in Milwaukee, for the 4-day 2003 Conference on Information Technology Presented by the League for Innovation— this is te big daddy conference on technology on community colleges. You can count on about 30 simultaneous sessions, enough to make you dizzy, and interaction with a few thousand other community college types. I […]
    • “Learning Grants” Presentation Finally. This is the last of four conference presentations assembled this month, the dog and pony show marathon is almost done. Supporting Faculty Innovation with Maricopa Learning Grant$ is a second presentation I am involved in at the League for Innovation Conference on Information Technology in Milwaukee. Wow this one was finished with almost 36 […]
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 October 18th

  • 2022
  • 2021
    • Flipping the Setup: Taking a Podcast on the Road It seems like you can hardly spit these days without hitting a podcast. Spit at me, I am at it too! What you can do these days (like having a web based multi-source recording studio, like Zencastr is far ahead of what I was doing in 2006 with a tiny pocket sized digital recorder. I’ve […] &amp#x27A1;
    • H5Ping With H5P, in a way, Syndication People have pretty much lost track of the syndication bus, small things joined in any way, and talking about things like RSS is a sure fire way for some kid to make fun of grandpa on TikTok. It still runs strong in me. Heck I just tested putting a Hypothes.is RSS feed into Feed2JS. It […] &amp#x27A1;
  • 2019
    • Explaining the Cost of Insulin Borders on Insanity This month marks the 49th year since I was diagnosed as a Type 1 diabetic. Back in 1970 they actually hospitalized me 10 days to stabilize my sugar levels and to educate me and my parents about this new routine of daily injections. I do not remember my parents worrying about the cost of medication. […] &amp#x27A1;
  • 2016
    • Explode Yourself As an alternative to the myopic sounds of news on the radio these days, I’m turning up the amount of podcast listening when I have more than 30 driving. One show I have been really enjoying is Song Exploder: Song Exploder is a podcast where musicians take apart their songs, and piece by piece, tell […] &amp#x27A1;
  • 2011
    • How The Heck Did I Get to Philly? Things are getting crazy here in the underground. Perhaps it is dark matter or super neutrinos, but I have somehow been transported through some sort of space/time dimension. Let’s recap what’s been happening. When I last reported, I was sticking to the instructions/clues provided by @0pcode49 and following the railroad tracks. Spooked by the scary […] &amp#x27A1;
    • Bava Bava The Dancing Animated GIF Machine This was purely an academic exercuse (that typo is intentional) in learning how to import video into Photoshop and use animation and masks to create animated GIFs. I just used a random video I had laying around in the Storybox. First turn on the music… Get up out of your chair and dance along: FYI […] &amp#x27A1;
  • 2008
    • Tilt-Shifting Fun Telegraph Hill Tilt Shift by cogdogblog posted 19 Oct ’08, 12.10am MDT PST on flickr Inspired by a link from kotke to the Fenway Park "Model", I experimented with the Fake Model method. Essentially it is a PhotoShop play of careful gradient selection and lens blur to create effects that convert real photos to images […] &amp#x27A1;
  • 2005
    • Me 2.0 Faster then a speeding meme, more hot that the surface of the sun, all one needs now for a “sexy” technology name is to tack on a “2.0”. Already tired and expired is putting an “i” in front of every noun, even more tired/ more expired is putting the “e” in front of everything. Submitted […] &amp#x27A1;
    • Running / Blogging / Running I have an unwritten internal filter on the range of topics blogged here. For a personal venture I have taken up, to run a half marathon in January, I decided to set up as its own blog, on my own domain. So I won’t be really writing about it here- you can see the full […] &amp#x27A1;
    • What’s In an URL? There are big URLs, little URLs, long convoluted database generated URLs. I’ve always leaned a bit towards the side of the fence where web site addresses that indicate what their content points to is a bit more useful than long meaningless ones. But it may not even matter. I was struck by this today visiting […] &amp#x27A1;
  • 2004
    • Denver Bound In a few clicks, I’m off to the airport for Denver heading there for the EDUCAUSE 2004 Conference Extravaganza. With good wireless connectivity, I hope to blog what I can. Tomorrow Brian and I will be rounding up some objects in our pre-conference seminar, “Decentralization of Learning Resources: Syndicating Learning Objects Using RSS, TrackBack, and […] &amp#x27A1;
    • Why Is Blogger.com Hiding the RSS? Let it Out! Under the powerful Google umbrella, Blogger.com is a huge player in the blog-verse offering totally free, hosted blogs, and they are now even looking less cheesy than a few years back. But for being the heavy weight, they are keeping RSS Feeds a hidden gem only known to those that care to put on their […] &amp#x27A1;
  • 2003
    • Bloggin’ da League Conf Well here I am in Milwaukee, for the 4-day 2003 Conference on Information Technology Presented by the League for Innovation— this is te big daddy conference on technology on community colleges. You can count on about 30 simultaneous sessions, enough to make you dizzy, and interaction with a few thousand other community college types. I […] &amp#x27A1;
    • “Learning Grants” Presentation Finally. This is the last of four conference presentations assembled this month, the dog and pony show marathon is almost done. Supporting Faculty Innovation with Maricopa Learning Grant$ is a second presentation I am involved in at the League for Innovation Conference on Information Technology in Milwaukee. Wow this one was finished with almost 36 […] &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.

    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 *