“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 10th

  • 2024
    • Amazing Still Happens. The Incalculable Odds of Clicking My Way Back to Phenix Just when one might think the glorious, joyful, unlimited potential of the internet has cratered to an ad-laden pool of machine generated goop, amazingness happens again. The odds of what I will lay out here seem improbable. Well, someone can likely do a back of the napkin estimate. While I have hung up efforts to […]
  • 2021
    • SPLOT Breakthrough on a Feature Maybe No One Will Ever Use SPLOTs just won’t go away [from this blog]. I recently celebrated some success in building a new part of the machine, then realizing it’s use case might be narrow. So while no one needs say a third arm, the process of designing it often has unexpected payoffs later. It Came About Because I Messed Up […]
  • 2017
    • SPLOT MAX: The Road Warrior This post has been rattling around in the only place I keep drafts– my brain. And I am pretty sure I will have spent more time photoshopping the movie poster below than writing something that makes sense. Jim Groom has been an international Road Warrior himself and I was excited to see he was not […]
  • 2016
    • Those Gopher Holes Go Far Like others, in terms of wandering/exploring the web, I often use the expression of being lost “down the rabbit hole”- An Alice in Wonderland phrase. But maybe, a gopher hole is more appropriate, given one of the earlier internet hypertext spaces, one I explored before the web came around. In a way, I was gopher […]
  • 2014
    • Stalking the Mythical OER Reuse They are out there… At the crack of 6:30am Friday I was doing a remote presentation for the Ontario Universities’ Council on e-Learning (OUCEL), via request from  colleagues there. Given that hour, I took some liberty with the seriousness and invoked the metaphor of the passion and conviction of those that pursue Sasquatch.  Share this […]
    • Walking [in medium] With/Without Abbey I’m still curious and intrigued by the writing environment of medium.com, though it will always be third fiddle to this blog. I was conversing with someone recently about the ease at which people misjudge the desert environment, what I have described as a dangerous gulf between over-estimating one’s abilities and under-estimating the desert environment. It […]
    • Hello [The Wire] Baltimore As usual in my house yesterday I had NPR Radio on in the background. The show Wait Wait Don’t Tell Me had a segment with Baltimore filmmaker John Waters as guest. PETER SAGAL: In April 2011, we talked to a man who’s made some of our favorite movies ““ John Waters, who went to the […]
  • 2013
    • Bone Glow There are times when I am in a place, in a space, when my gut instinct says, “there is an interesting photo here” even if I do not know exactly what it is. Usually it is vivid or interesting light, as was partly the case here, This photo is from a store in Flagstaff Arizona […]
  • 2011
    • 0.25 Canada Damn, Canada is a big place. I’m 10 days in, and thought maybe I was 1/3 the way, but looking at this map (pink is where I have been, green where I think I am going) I am lucky if I have traversed a quarter of the Great Baconated North. Heck, Looking at where I […]
  • 2007
    • Reading Across or Reading Down Feeds Ah, my poor RSS Reader, not nearly given the devoted attention once reserved for it. Maybe a year, maybe two ago, I’d focus on at least scanning all my sources and marking them read by end of the day, even if it was in one fell keyboard stroke. That was BT (Before Twitter), BSL (Before […]
  • 2006
    • Blogging About What I MIght be Blogging About This is for my own “to do” list most of all, but I have a wheelbarrow full of stuff I’ve been immersed in (and 3 more palettes piled high with new things to do), but to be blogged sometime between tomorrow and the end of time…. * A Drupal State of Mind: in line with […]
    • Ideal Streaming Technology flickr foto Searching for the Ideal Streaming Technology posteravailable on flickr Searching for the Ideal Streaming Technology poster as reprised on the NMC Campus in Second Life (July 2006), This was a study done in Spring 2006, and a number of NMC members had participated. Authors Dr. Edgar Huang and Clifford Marsiglio from IUPUI (Indiana […]
  • 2005
    • SAC 2005 Session on Collaboration Tools flickr foto SAC 2005 Session on Collaboration Toolsavailable on my flickr "Everybody say, I give permission to post my image on flickr!" Well, there is no way I am blogging my own session… that is someone elses job! This was the wild and open range discussion on “Collaboration Tools: What’s Out There?” and it was […]
  • 2004
    • Week of Digital Storytelling Workshop I’m spending the bulk of this week helping out at a 40 hour “learnshop” our office sponsors for faculty, this one is on Bringing Digital Storytelling to the Classroom (ingore the June dates, this was so popular it has been repeated). Facilitators Linda Hicks and Rachel Woodburn have been co-teaching a course in Digital Storytelling […]
  • 2003
    • Blog in Donnesbury-ville Fresh off the press! See a take on blogging in Doonesbury. None of us would troll for search engines, would we? <tiphat>found via RSS aggregator feed from the Shifted Librarian</tiphat>  Share this barking on social media
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 10th

  • 2024
  • 2021
    • SPLOT Breakthrough on a Feature Maybe No One Will Ever Use SPLOTs just won’t go away [from this blog]. I recently celebrated some success in building a new part of the machine, then realizing it’s use case might be narrow. So while no one needs say a third arm, the process of designing it often has unexpected payoffs later. It Came About Because I Messed Up […] &amp#x27A1;
  • 2017
    • SPLOT MAX: The Road Warrior This post has been rattling around in the only place I keep drafts– my brain. And I am pretty sure I will have spent more time photoshopping the movie poster below than writing something that makes sense. Jim Groom has been an international Road Warrior himself and I was excited to see he was not […] &amp#x27A1;
  • 2016
    • Those Gopher Holes Go Far Like others, in terms of wandering/exploring the web, I often use the expression of being lost “down the rabbit hole”- An Alice in Wonderland phrase. But maybe, a gopher hole is more appropriate, given one of the earlier internet hypertext spaces, one I explored before the web came around. In a way, I was gopher […] &amp#x27A1;
  • 2014
    • Stalking the Mythical OER Reuse They are out there… At the crack of 6:30am Friday I was doing a remote presentation for the Ontario Universities’ Council on e-Learning (OUCEL), via request from  colleagues there. Given that hour, I took some liberty with the seriousness and invoked the metaphor of the passion and conviction of those that pursue Sasquatch.  Share this […] &amp#x27A1;
    • Walking [in medium] With/Without Abbey I’m still curious and intrigued by the writing environment of medium.com, though it will always be third fiddle to this blog. I was conversing with someone recently about the ease at which people misjudge the desert environment, what I have described as a dangerous gulf between over-estimating one’s abilities and under-estimating the desert environment. It […] &amp#x27A1;
    • Hello [The Wire] Baltimore As usual in my house yesterday I had NPR Radio on in the background. The show Wait Wait Don’t Tell Me had a segment with Baltimore filmmaker John Waters as guest. PETER SAGAL: In April 2011, we talked to a man who’s made some of our favorite movies ““ John Waters, who went to the […] &amp#x27A1;
  • 2013
    • Bone Glow There are times when I am in a place, in a space, when my gut instinct says, “there is an interesting photo here” even if I do not know exactly what it is. Usually it is vivid or interesting light, as was partly the case here, This photo is from a store in Flagstaff Arizona […] &amp#x27A1;
  • 2011
    • 0.25 Canada Damn, Canada is a big place. I’m 10 days in, and thought maybe I was 1/3 the way, but looking at this map (pink is where I have been, green where I think I am going) I am lucky if I have traversed a quarter of the Great Baconated North. Heck, Looking at where I […] &amp#x27A1;
  • 2007
    • Reading Across or Reading Down Feeds Ah, my poor RSS Reader, not nearly given the devoted attention once reserved for it. Maybe a year, maybe two ago, I’d focus on at least scanning all my sources and marking them read by end of the day, even if it was in one fell keyboard stroke. That was BT (Before Twitter), BSL (Before […] &amp#x27A1;
  • 2006
    • Blogging About What I MIght be Blogging About This is for my own “to do” list most of all, but I have a wheelbarrow full of stuff I’ve been immersed in (and 3 more palettes piled high with new things to do), but to be blogged sometime between tomorrow and the end of time…. * A Drupal State of Mind: in line with […] &amp#x27A1;
    • Ideal Streaming Technology flickr foto Searching for the Ideal Streaming Technology posteravailable on flickr Searching for the Ideal Streaming Technology poster as reprised on the NMC Campus in Second Life (July 2006), This was a study done in Spring 2006, and a number of NMC members had participated. Authors Dr. Edgar Huang and Clifford Marsiglio from IUPUI (Indiana […] &amp#x27A1;
  • 2005
    • SAC 2005 Session on Collaboration Tools flickr foto SAC 2005 Session on Collaboration Toolsavailable on my flickr "Everybody say, I give permission to post my image on flickr!" Well, there is no way I am blogging my own session… that is someone elses job! This was the wild and open range discussion on “Collaboration Tools: What’s Out There?” and it was […] &amp#x27A1;
  • 2004
    • Week of Digital Storytelling Workshop I’m spending the bulk of this week helping out at a 40 hour “learnshop” our office sponsors for faculty, this one is on Bringing Digital Storytelling to the Classroom (ingore the June dates, this was so popular it has been repeated). Facilitators Linda Hicks and Rachel Woodburn have been co-teaching a course in Digital Storytelling […] &amp#x27A1;
  • 2003
    • Blog in Donnesbury-ville Fresh off the press! See a take on blogging in Doonesbury. None of us would troll for search engines, would we? <tiphat>found via RSS aggregator feed from the Shifted Librarian</tiphat>  Share this barking on social media &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 *