“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 16 posts previously published on March 30th

  • 2023
    • Footprints in the Web What kinds of web footprints are you leaving? Or does it matter since they just blow away? Where do you choose to do your walking? I am not talking about your data trails, am talking about the trails you make as a contribution for others. I know my answers, which are just mine, and are […]
  • 2019
    • The SPLOT Image Truck is Here! Cue the music… the truck is rolling through your neighborhood, blaring the music, here to deliver random images to all the kids– and the truck is fueled by json. THE SPLOT TRUCK IS HERE! This could be a way for the TRU Collector SPLOT to provide random images that might one day, be an alternative […]
  • 2018
    • On Syndicating Comments, Conversations Syndicating blog posts with Feed WordPress is a good tune, an old song here, from the heady days of early ds106 to my current class. But what about aggregating comments from multiple blogs? It’s come up often over the years, and recently in the Twitters by fellow RSS junkies It'd be interesting to look at […]
  • 2017
    • A SPLOT is Born, Say hello to Splotpoint Twas fitting to return these past three days to Thompson Rivers University in Kamloops BC, invited by Brian Lamb to spend some quick time with people and place I was 5 months at in 2014-2015 as an Open Learning Fellow (or Fella). It’s a Brian story that the idea for SPLOTs (fill in your own […]
  • 2016
    • How to be a Dickpreneur I opted to author this first in medium because that’s where people like “Richard” hang out. And yes “dick” is a bad word, but is also a nickname for “Richard” In which some annoyance over email spam likely descends into likely foul language ranting… and yes “dick” is a poor choice of language, but if […]
  • 2014
    • You Can’t Keep this Dog Down! A new flickr cc Attribution Helper cc licensed ( BY-SA ) flickr photo shared by cogdogblog A few days ago I bemoaned, whinged, the changes at flickr that rendered my flickr cc attribution helper tool DOA. At the mercy of third party providers who take a great service and just yank it away (ahem Google– Reader; ahem Twitter– posterous; the list […]
  • 2011
    • Five Place Map Poems As a variation on the Google Maps Story assignment for ds106, I was thinking of some other creations one could do via the maps. This was mulling through me head as I was driving this morning to Flagstaff via one of the prettiest highways, the Lake Mary Road north of Clints Well. So my game […]
    • Jack Burns is the Last Cowboy Whew, I finished my ds106 Video Essay assignment on Lonely are the Brave, the 1962 not-western starring Kirk Douglas. The movie is based on Edward Abbey’s second published novel, The Brave Cowboy. According to the extras on the DVD, Douglas was very taken by the novel and personally was driven to see that it was […]
  • 2008
    • Chaos / Order Chaos / Order by cogdogblog posted 30 Mar ’08, 11.54am MDT PST on flickr I finally got the pieces of my office desk up here, and with some cussing, drilling, glue managed to re-assemble it (a few of those cam/post things got mangled in my hast of packing up). So on the right side, meet […]
  • 2006
    • Thou Has a Hard Drive (start with TV announcer voice): Previously… on Lost. Just kidding. Previously on this blog, I wrote of my dilemma at home of dealing with a giant unorganized stack of digital photos. In cleaning out my office at Maricopa, I had a similar problem, but here, at least, I had a spare 240 Gb LaCie FireWire […]
    • When Silence Is Loud On The Net Like thousands, tens of thousands, maybe just short of McDonald’s order of magnitude (Billions and Billions) of other people, I am feeling the gaping information void of Stephen Downe’s hiatus. OLDaily been a mainstay of my ed tech input for so long I cannot remember, and it was Stephen’s work that opened my eyes to […]
    • Eventicitis As I clean up my web site directory, 14 years of accumulated stuff, I start wondering just how many web sites I had set up for our offices’ various projects and events. Not to be horn blowing, but I am staggered to see that I found 260 different event web sites dating back mostly to […]
    • Message From A Peanut Butter Chef Triggered by yesterday’s post on how one of our Spanish teachers started using PBWiki, I got a nice email from Ramit, one of the PBWiki co-founders, seeking ideas on how to “spread” the peanut butter / wiki concept to other teachers: I also noticed you’re involved in instructional technology, so I wanted to ask your […]
    • Flickr Photos Requested Twice this week I’ve gotten requests to use some of my flickr photos (and ironically both photos were taken in San Diego, but on different trips) for use on other web sites. The first was asking to use my Gaslamp photos (1 and 2) for a San Diego tourist guide site (sorry, I lost track […]
    • One More On Spam All this spam is bad for my cholesterol 😉 The prolific blog spammer “phuong” (at least 150 spam servings in the last month) is curious since he/she/it are not leaving any URLs in the spam insertion attempt, only a cryptic message like: Xin choa, Minh den tu HK, minh mong muon luoc lam quen vui […]
  • 2005
    • Van Google I’ve always admired Google for taking the time to do important things like rotating their logos. I was a little curios when I reached for my favorite web tool today to find something and saw: And of course a quickie search revealed that today is Vincent Van Gogh’s birthday. Among other things you get by […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 16 posts previously published on March 30th

  • 2023
    • Footprints in the Web What kinds of web footprints are you leaving? Or does it matter since they just blow away? Where do you choose to do your walking? I am not talking about your data trails, am talking about the trails you make as a contribution for others. I know my answers, which are just mine, and are […] &amp#x27A1;
  • 2019
    • The SPLOT Image Truck is Here! Cue the music… the truck is rolling through your neighborhood, blaring the music, here to deliver random images to all the kids– and the truck is fueled by json. THE SPLOT TRUCK IS HERE! This could be a way for the TRU Collector SPLOT to provide random images that might one day, be an alternative […] &amp#x27A1;
  • 2018
    • On Syndicating Comments, Conversations Syndicating blog posts with Feed WordPress is a good tune, an old song here, from the heady days of early ds106 to my current class. But what about aggregating comments from multiple blogs? It’s come up often over the years, and recently in the Twitters by fellow RSS junkies It'd be interesting to look at […] &amp#x27A1;
  • 2017
    • A SPLOT is Born, Say hello to Splotpoint Twas fitting to return these past three days to Thompson Rivers University in Kamloops BC, invited by Brian Lamb to spend some quick time with people and place I was 5 months at in 2014-2015 as an Open Learning Fellow (or Fella). It’s a Brian story that the idea for SPLOTs (fill in your own […] &amp#x27A1;
  • 2016
    • How to be a Dickpreneur I opted to author this first in medium because that’s where people like “Richard” hang out. And yes “dick” is a bad word, but is also a nickname for “Richard” In which some annoyance over email spam likely descends into likely foul language ranting… and yes “dick” is a poor choice of language, but if […] &amp#x27A1;
  • 2014
    • You Can’t Keep this Dog Down! A new flickr cc Attribution Helper cc licensed ( BY-SA ) flickr photo shared by cogdogblog A few days ago I bemoaned, whinged, the changes at flickr that rendered my flickr cc attribution helper tool DOA. At the mercy of third party providers who take a great service and just yank it away (ahem Google– Reader; ahem Twitter– posterous; the list […] &amp#x27A1;
  • 2011
    • Five Place Map Poems As a variation on the Google Maps Story assignment for ds106, I was thinking of some other creations one could do via the maps. This was mulling through me head as I was driving this morning to Flagstaff via one of the prettiest highways, the Lake Mary Road north of Clints Well. So my game […] &amp#x27A1;
    • Jack Burns is the Last Cowboy Whew, I finished my ds106 Video Essay assignment on Lonely are the Brave, the 1962 not-western starring Kirk Douglas. The movie is based on Edward Abbey’s second published novel, The Brave Cowboy. According to the extras on the DVD, Douglas was very taken by the novel and personally was driven to see that it was […] &amp#x27A1;
  • 2008
    • Chaos / Order Chaos / Order by cogdogblog posted 30 Mar ’08, 11.54am MDT PST on flickr I finally got the pieces of my office desk up here, and with some cussing, drilling, glue managed to re-assemble it (a few of those cam/post things got mangled in my hast of packing up). So on the right side, meet […] &amp#x27A1;
  • 2006
    • Thou Has a Hard Drive (start with TV announcer voice): Previously… on Lost. Just kidding. Previously on this blog, I wrote of my dilemma at home of dealing with a giant unorganized stack of digital photos. In cleaning out my office at Maricopa, I had a similar problem, but here, at least, I had a spare 240 Gb LaCie FireWire […] &amp#x27A1;
    • When Silence Is Loud On The Net Like thousands, tens of thousands, maybe just short of McDonald’s order of magnitude (Billions and Billions) of other people, I am feeling the gaping information void of Stephen Downe’s hiatus. OLDaily been a mainstay of my ed tech input for so long I cannot remember, and it was Stephen’s work that opened my eyes to […] &amp#x27A1;
    • Eventicitis As I clean up my web site directory, 14 years of accumulated stuff, I start wondering just how many web sites I had set up for our offices’ various projects and events. Not to be horn blowing, but I am staggered to see that I found 260 different event web sites dating back mostly to […] &amp#x27A1;
    • Message From A Peanut Butter Chef Triggered by yesterday’s post on how one of our Spanish teachers started using PBWiki, I got a nice email from Ramit, one of the PBWiki co-founders, seeking ideas on how to “spread” the peanut butter / wiki concept to other teachers: I also noticed you’re involved in instructional technology, so I wanted to ask your […] &amp#x27A1;
    • Flickr Photos Requested Twice this week I’ve gotten requests to use some of my flickr photos (and ironically both photos were taken in San Diego, but on different trips) for use on other web sites. The first was asking to use my Gaslamp photos (1 and 2) for a San Diego tourist guide site (sorry, I lost track […] &amp#x27A1;
    • One More On Spam All this spam is bad for my cholesterol 😉 The prolific blog spammer “phuong” (at least 150 spam servings in the last month) is curious since he/she/it are not leaving any URLs in the spam insertion attempt, only a cryptic message like: Xin choa, Minh den tu HK, minh mong muon luoc lam quen vui […] &amp#x27A1;
  • 2005
    • Van Google I’ve always admired Google for taking the time to do important things like rotating their logos. I was a little curios when I reached for my favorite web tool today to find something and saw: And of course a quickie search revealed that today is Vincent Van Gogh’s birthday. Among other things you get by […] &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 *