“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 18 posts previously published on July 16th

  • 2014
    • Like a Leatherman for Your WordPress Blog creative commons licensed ( BY ) flickr photo shared by brian.ch I have a tool… well it might not be quite as good as a Leatherman, but I use it almost every day to search my blog. And I built it 9 years ago. If you cannot wade through my story just go there. But […]
    • 10 Years, 38,000 Photos, 1 Explore How about that, my very first photo goes into flickr Explore I’ve hung 38,000 photos in flickr since 2004, stayed with flickr, even defended it despite all of the Yahoo’d changes (though I did call them an ass). And not even for a photo I would call my best (I keep my favorites over at […]
    • Feed WordPress 101: Installing and Setting Up The Machine This is part 2 of 5 in a series of posts for Building Connected Courses: Feed WordPress 101. Basic Concepts of Syndication – and what to think about even before you touch that WordPress thing »» Installing and Setting up Feed WordPress «« – Minimal settings, and planning the way content is sliced, diced, and […]
  • 2013
    • ds106 Daily Create Challenge (16): Some More McBorscht, Mr Snowden? cc licensed ( BY NC SA ) flickr photo shared by Claus Wolf Today’s ds106 Daily Create challenge is a writing one based on the brevity of twitter: Write a story dialogue in 5 half-twits (lines that are 70 characters each) The Urban Dictionary defines a Half-Twit as “A 70-character message, which is half of […]
  • 2012
    • Mashup or Remix? In preparation for this week’s topic for ds106 I opted to put out a question via twitter to get input on how you explain the differences between mashups and remixes (I get sloppy and move somewhere in the vague area between). Probably the best outcome was getting clued into Star Wars Call Me Maybe. Shannon […]
    • Now It’s the Seven Day Daily Create Challenge Mashup cc licensed ( BY NC ) flickr photo shared by Darwin Bell Things are really going super duper with responses to the Seven Day Daily Create Challenge, where last Wednesday I dared y’all (that means you, all 4 billion people in the internet) to do a ds106 Daily Create seven days in row. People are […]
    • Day 4: Annoying Telemarketing Call Day 4 of the Seven Day Daily Create Challenge brings you an audio challenge, to record an audio of a really annoying telemarketing call. Obviously many people have gotten these! We have to date 18 of them in the collection. There was definitely some fun with it as people came up with annoying voices or […]
  • 2010
    • The Utter Uselessness of Twitter Search cc licensed flickr photo shared by Mizrak While Twitter is all about “what are you doing now” it is mostly useless to try and find out “what I did last month”. The search capability feels more like pulling a slot machine handle in terms of feeling like you will hit a jackpot. The Library of […]
    • Newest Leader in Stupidest Email Spam Attempt Ever THIS MESSAGE IS FROM OUR TECHNICAL SUPPORT TEAM This message is sent automatically by the computer. If you are receiving this message it means that your email address has been queued for deactivation; this was as a result of a continuous error script (code:505)received from this email address. To resolve this problem you must reset […]
  • 2008
    • Sydney Meetup, Walk, Whatever If you are in Sydney on Saturday and game to play dodge the pilgrammage crowd game, then join me and my NMC colleagues for a walk somewhere on a beach or around the harbor… er “harbour”. That’s th eplace with the funky curve building. I think they do art stuff there or maybe it is […]
  • 2007
    • No More Bad Behavior with Bad Behavior on the Prowl Over the years, angry blog posts about spam is my most frequent blog post activity (well, until Twitter came out). I’ve been long resigned to scripted onslaughts of attempts to insert unwanted content into the comment space as a SFOL (Sad Fact of Life). For the most part, I’ve had excellent luck with Spam karma […]
    • Sick Mashup No, this is not something to gross you out. Who is Sick is a mashup of google maps and people’s self reports of their illness– it provides some data so supposedly you could find out if that queasy feeling in your stomach is…. well something a lot of people in the hood are keeping down. […]
    • Beth Made Me Do It What could be better than a good bone? How about Dogbook? Cadu is now part of my profile! Woo! Linktribution to Beth, thanks! So will everything find its way to Facebook? Will it consume Yahoo, Google, the very earth itself?  Share this barking on social media
    • Spam Haiku To the “person” who laboriously took the time, thought, passion, to craft this slow- roasted comment: jshucwk muenyzck lfdjrkzv pjirmq hyakosr jcrensg fvdtahqo I can only reply: obɥɐʇpʌɟ ƃsuǝɹɔɾ ɹsoʞɐʎɥ bɯɹıɾd ÊŒzʞɹɾpÉŸl ʞɔzÊŽuǝnɯ ʞʍɔnÉ¥sɾ It will simmer forever in my Spam Karma 2 steamer, never to see the light of anything google-able.  Share this barking […]
  • 2006
    • Bad Aftertaste At Apple Store I had a bad feeling about the loud clickity fan noises coming from my MacBookPro. With the heat this laptops put out, loosing its cooling mechanism would be big bad karma for my work machine. Since the laptop was still under warranty, I trundled off to the Apple Store in Phoenix, knowing it would likely […]
  • 2003
    • Bonus Feature for MT Bookmarklet Scott Leslie recently posted some well deserved praise for Bookmarklets (little Javascripts to perform tasks), citing them as vastly under-used but powerful tools in your web browser. The MovableType Bookmarklet makes blogging any website a snap, see our Blogging with the MT Bookmarklet summary. But by pure accident, I discovered this tool has an added […]
    • New RSS Feed: Teaching and Learning on the Web Building on the code done for adding RSS to our DirectorWeb site, it took less than an hour to integrate it into our Teaching & Learning on the Web. Once again, adding RSS was wonderfully simple. You can find this new feed at http://www.mcli.dist.maricopa.edu/tl/new.rss  Share this barking on social media
    • NaDa: Does Nothing for Everybody On an extremely light note… hurry now and download your copy of NaDa, only 1k! “Nada does nothing for everybody”. Most products we see on the market want to increase our productivity, organize our screen joyfully or make wonders with our sound card, but NaDa™ does nothing. This is a revolutionary whole new approach, a […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 18 posts previously published on July 16th

  • 2014
    • Like a Leatherman for Your WordPress Blog creative commons licensed ( BY ) flickr photo shared by brian.ch I have a tool… well it might not be quite as good as a Leatherman, but I use it almost every day to search my blog. And I built it 9 years ago. If you cannot wade through my story just go there. But […] &amp#x27A1;
    • 10 Years, 38,000 Photos, 1 Explore How about that, my very first photo goes into flickr Explore I’ve hung 38,000 photos in flickr since 2004, stayed with flickr, even defended it despite all of the Yahoo’d changes (though I did call them an ass). And not even for a photo I would call my best (I keep my favorites over at […] &amp#x27A1;
    • Feed WordPress 101: Installing and Setting Up The Machine This is part 2 of 5 in a series of posts for Building Connected Courses: Feed WordPress 101. Basic Concepts of Syndication – and what to think about even before you touch that WordPress thing »» Installing and Setting up Feed WordPress «« – Minimal settings, and planning the way content is sliced, diced, and […] &amp#x27A1;
  • 2013
    • ds106 Daily Create Challenge (16): Some More McBorscht, Mr Snowden? cc licensed ( BY NC SA ) flickr photo shared by Claus Wolf Today’s ds106 Daily Create challenge is a writing one based on the brevity of twitter: Write a story dialogue in 5 half-twits (lines that are 70 characters each) The Urban Dictionary defines a Half-Twit as “A 70-character message, which is half of […] &amp#x27A1;
  • 2012
    • Mashup or Remix? In preparation for this week’s topic for ds106 I opted to put out a question via twitter to get input on how you explain the differences between mashups and remixes (I get sloppy and move somewhere in the vague area between). Probably the best outcome was getting clued into Star Wars Call Me Maybe. Shannon […] &amp#x27A1;
    • Now It’s the Seven Day Daily Create Challenge Mashup cc licensed ( BY NC ) flickr photo shared by Darwin Bell Things are really going super duper with responses to the Seven Day Daily Create Challenge, where last Wednesday I dared y’all (that means you, all 4 billion people in the internet) to do a ds106 Daily Create seven days in row. People are […] &amp#x27A1;
    • Day 4: Annoying Telemarketing Call Day 4 of the Seven Day Daily Create Challenge brings you an audio challenge, to record an audio of a really annoying telemarketing call. Obviously many people have gotten these! We have to date 18 of them in the collection. There was definitely some fun with it as people came up with annoying voices or […] &amp#x27A1;
  • 2010
    • The Utter Uselessness of Twitter Search cc licensed flickr photo shared by Mizrak While Twitter is all about “what are you doing now” it is mostly useless to try and find out “what I did last month”. The search capability feels more like pulling a slot machine handle in terms of feeling like you will hit a jackpot. The Library of […] &amp#x27A1;
    • Newest Leader in Stupidest Email Spam Attempt Ever THIS MESSAGE IS FROM OUR TECHNICAL SUPPORT TEAM This message is sent automatically by the computer. If you are receiving this message it means that your email address has been queued for deactivation; this was as a result of a continuous error script (code:505)received from this email address. To resolve this problem you must reset […] &amp#x27A1;
  • 2008
    • Sydney Meetup, Walk, Whatever If you are in Sydney on Saturday and game to play dodge the pilgrammage crowd game, then join me and my NMC colleagues for a walk somewhere on a beach or around the harbor… er “harbour”. That’s th eplace with the funky curve building. I think they do art stuff there or maybe it is […] &amp#x27A1;
  • 2007
    • No More Bad Behavior with Bad Behavior on the Prowl Over the years, angry blog posts about spam is my most frequent blog post activity (well, until Twitter came out). I’ve been long resigned to scripted onslaughts of attempts to insert unwanted content into the comment space as a SFOL (Sad Fact of Life). For the most part, I’ve had excellent luck with Spam karma […] &amp#x27A1;
    • Sick Mashup No, this is not something to gross you out. Who is Sick is a mashup of google maps and people’s self reports of their illness– it provides some data so supposedly you could find out if that queasy feeling in your stomach is…. well something a lot of people in the hood are keeping down. […] &amp#x27A1;
    • Beth Made Me Do It What could be better than a good bone? How about Dogbook? Cadu is now part of my profile! Woo! Linktribution to Beth, thanks! So will everything find its way to Facebook? Will it consume Yahoo, Google, the very earth itself?  Share this barking on social media &amp#x27A1;
    • Spam Haiku To the “person” who laboriously took the time, thought, passion, to craft this slow- roasted comment: jshucwk muenyzck lfdjrkzv pjirmq hyakosr jcrensg fvdtahqo I can only reply: obɥɐʇpʌɟ ƃsuǝɹɔɾ ɹsoʞɐʎɥ bɯɹıɾd ÊŒzʞɹɾpÉŸl ʞɔzÊŽuǝnɯ ʞʍɔnÉ¥sɾ It will simmer forever in my Spam Karma 2 steamer, never to see the light of anything google-able.  Share this barking […] &amp#x27A1;
  • 2006
    • Bad Aftertaste At Apple Store I had a bad feeling about the loud clickity fan noises coming from my MacBookPro. With the heat this laptops put out, loosing its cooling mechanism would be big bad karma for my work machine. Since the laptop was still under warranty, I trundled off to the Apple Store in Phoenix, knowing it would likely […] &amp#x27A1;
  • 2003
    • Bonus Feature for MT Bookmarklet Scott Leslie recently posted some well deserved praise for Bookmarklets (little Javascripts to perform tasks), citing them as vastly under-used but powerful tools in your web browser. The MovableType Bookmarklet makes blogging any website a snap, see our Blogging with the MT Bookmarklet summary. But by pure accident, I discovered this tool has an added […] &amp#x27A1;
    • New RSS Feed: Teaching and Learning on the Web Building on the code done for adding RSS to our DirectorWeb site, it took less than an hour to integrate it into our Teaching & Learning on the Web. Once again, adding RSS was wonderfully simple. You can find this new feed at http://www.mcli.dist.maricopa.edu/tl/new.rss  Share this barking on social media &amp#x27A1;
    • NaDa: Does Nothing for Everybody On an extremely light note… hurry now and download your copy of NaDa, only 1k! “Nada does nothing for everybody”. Most products we see on the market want to increase our productivity, organize our screen joyfully or make wonders with our sound card, but NaDa™ does nothing. This is a revolutionary whole new approach, a […] &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 *