“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 20 posts previously published on December 3rd

  • 2021
    • Small Pieces Still Joined. Cool. Just using those words in the title sends the warning flag that this is a grey bearded old man of the internet post. So the idea of connecting together independent bits of the web to do something useful might by yelling at a cloud (or The Cloud), but damnit, it all works for me. Sit […]
    • Adding Some Polish (small features) to the Three Main SPLOTs Like some shiny dress shoes, my SPLOT themes just got a wee bit of polish based on some needs others had. I also made an effort to make sure the three main ones TRU Writer, TRU Collector, and SPLOTbox all got the same shine. This also reinforces what has been true since the first SPLOTs […]
  • 2019
    • A Shinier DS106 Assignment Bank Theme I’ve been deep in the code tunnels rebuilding and adding to maybe my most complex WordPress theme, the one that let’s anyone build something like the original DS106 Assignment Bank. My blog machine spits out a long list of posts on this effort, and indicates it goes back to August 2013, so while it pre-dates […]
  • 2018
    • Improvisieren mit Zufälligen Fotos: Pechaflickr Jumps the Language Shark This was a nice surprise to see early in my Twitter gazing this morning. @cogdog I've made a version in German language of your fantastic Pechaflickr – also with some other changes (e.g. sorting only by relevance):> https://t.co/YgvMu3xBx5 Thanks a lot for the great idea & the code! — Nele Hirsch (@eBildungslabor) December 3, 2018 […]
    • The Proverbial Why Blog Post (and is it a Howitzer?) Blogging about blogging is a repeated trope inside this blog and I’d bet commonly elsewhere. Why do it again? It seems appropriate for my last (and consistently late, but one of the things about blogging is making your own rules) of nine posts for the Ontario Extend 9x9x25 challenge. I actually realized I was more […]
  • 2016
    • Las nuevas frases de viaje útiles español cada viajero debe aprender I’m getting ready to leave Tuesday for another trip to Guadalajara for the UDG Agora project as well as getting to spend some time visiting Ken Bauer. I should be practicing my childlike command of Spanish (“Hablo español como un niño de tres años”). Maybe I need to refresh by visiting those sites that help […]
    • You(Tubers) Dissin’ My Dead Drops? Drawing conclusions about human nature based upon a small spike in YouTube comments is maybe as questionable as predicting election results based on polls. But hey, this is my data! For a likely inexplicable reason, I have gotten a small burst of comments recently on one of my YouTube videos (a burst on my videos […]
  • 2015
    • One Photo. Zero Paradoxes. Or Many. Warning: This blog post inspired by of all things a ‘favorite’ of a photo, and is being written without too much direction where it will go. This is just one photo of mine. Someone recently favorited it in flickr (apparently Yahoo has not gotten the Twitter notice that Likes are the thing). For whatever inexplicable […]
  • 2014
    • Creative Commons Ought to Travel With the Media From some banter via twitter this morning with Clint Lalonde and Pat Lockley, it occurred to me a great challenge to Creative Commons is that the license is metadata that is usually separated from the content it refers too– e.g. it is extra code in a web page, or additional information stored with a photo […]
    • The Little Things I’ve been grateful for the deluxe accommodations that has been provided for my fourth month visit at Thompson Rivers University. I’m on the fancy floor of suites, above 10 floors of student residences. The floor I am on (I think) they run out of their Hospitality program, so there are students in that program working […]
  • 2013
    • YAOOCS (Yet Another Open Online Course Started)… cc licensed ( BY NC SA ) flickr photo shared by Since EBCDIC Move along. I thought this course would be The One. The One I Finished. It’s not the course’s fault at all, it’s all PEBKAC. I was eager to dive into the P2PU course Play With Your Music: “Play With Your Music” is […]
  • 2011
    • Why Does Google Obscure Searches for Content Licensed for Re-use? Not unlike the scared question of how many licks does it take to get to the center of a Tootsie Pop, I just counted six clicks needed to do a Google Image search for content that is licensed for reuse. Six. Here we go. (1) Go to Google image search. It has that new sparse […]
    • Open Courses / Open Minds I did not catch the stream of the ds106 presentation at the CUNY conference by Mikhail Gershovich and Michael Branson-Smith, so I did not hear their response- but Mikhail’s tweet bemused me: Amusing because who can really say what a University “feels”? Nah. It really shows how thin the understanding is of an open course, […]
    • (Late) Book Report: The Legend of Colton H. Bryant The Legend of Colton H. Bryant was a book that Barbara Ganley recommended when I was in the first legs of my road odyssey, because of its setting in Wyoming where I was traversing. Of course, I had to follow the suggestion, and had downloaded it to my Kindle on my iPad… where it languished […]
  • 2010
    • From Cape Town OER to Spanish Journal Article: Newest Amazing Story Here is my newest Amazing Story of Sharing of 2010 (not THE newest, because they are happening all the time). Last week I wrote of an unsolicited message from Michael Paskevicius of the University of Cape Town OER Project, eager to share the story of an open resource shared by Matumo Ramafikeng, a teacher at […]
  • 2009
    • Dive into Dogs Over this morning’s coffee I was rummaging around my flickr stats. Yum, stats. If you have never done this, there is an incredible amount if interesting information you can find there, like I have no idea why there was a spike of 2000+ views on November 22. Or you can find which of your photos […]
  • 2004
    • Sony Stomps on Kottke Bloggers can start feeling like their voice is powerful, but the power may be vaporized in the face of multibillion dollar companies. Jason Kottke, who has had a great running fascination with Ken Jenning’s wild Jeopardy marathon, apparently is being threatened by Sony (who owns the show and likely 1/3 of the planet) is spanking […]
    • Is eBay Customer ‘Service’ Smokin’ Crack? If you think I get overly torqued about spammers, poor web site from big entities and doofus customer service is right up there as well. I continually deal with some online banking and bill paying service that works marvelously, and yet fight others (hello CitiBank) that offer “service” that is browser dependent or completely dysfunctional. […]
  • 2003
    • “Where have all the bloggers gone?” Cue the folk music, Pete… Where have all the bloggers gone? Long time passing. Where have all the bloggers gone? Long time ago. Where have all the bloggers gone? Spammers have picked them ev’ry one. Oh, when will you ever learn? Oh, when will you ever learn? My RSS reader stays pretty grey these days. […]
    • Does Rackspace.com coddle Spam Roaches? I thought I really had nailed a blog spammer by tracking down the internet provider, documenting, and submitting all the information to the appropriate abuse contact. What I got in return was zilch. Why would an internet provider protect me from spammers? They might be paying customers and I am not.  Share this barking on […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 20 posts previously published on December 3rd

  • 2021
    • Small Pieces Still Joined. Cool. Just using those words in the title sends the warning flag that this is a grey bearded old man of the internet post. So the idea of connecting together independent bits of the web to do something useful might by yelling at a cloud (or The Cloud), but damnit, it all works for me. Sit […] &amp#x27A1;
    • Adding Some Polish (small features) to the Three Main SPLOTs Like some shiny dress shoes, my SPLOT themes just got a wee bit of polish based on some needs others had. I also made an effort to make sure the three main ones TRU Writer, TRU Collector, and SPLOTbox all got the same shine. This also reinforces what has been true since the first SPLOTs […] &amp#x27A1;
  • 2019
    • A Shinier DS106 Assignment Bank Theme I’ve been deep in the code tunnels rebuilding and adding to maybe my most complex WordPress theme, the one that let’s anyone build something like the original DS106 Assignment Bank. My blog machine spits out a long list of posts on this effort, and indicates it goes back to August 2013, so while it pre-dates […] &amp#x27A1;
  • 2018
    • Improvisieren mit Zufälligen Fotos: Pechaflickr Jumps the Language Shark This was a nice surprise to see early in my Twitter gazing this morning. @cogdog I've made a version in German language of your fantastic Pechaflickr – also with some other changes (e.g. sorting only by relevance):> https://t.co/YgvMu3xBx5 Thanks a lot for the great idea & the code! — Nele Hirsch (@eBildungslabor) December 3, 2018 […] &amp#x27A1;
    • The Proverbial Why Blog Post (and is it a Howitzer?) Blogging about blogging is a repeated trope inside this blog and I’d bet commonly elsewhere. Why do it again? It seems appropriate for my last (and consistently late, but one of the things about blogging is making your own rules) of nine posts for the Ontario Extend 9x9x25 challenge. I actually realized I was more […] &amp#x27A1;
  • 2016
    • Las nuevas frases de viaje útiles español cada viajero debe aprender I’m getting ready to leave Tuesday for another trip to Guadalajara for the UDG Agora project as well as getting to spend some time visiting Ken Bauer. I should be practicing my childlike command of Spanish (“Hablo español como un niño de tres años”). Maybe I need to refresh by visiting those sites that help […] &amp#x27A1;
    • You(Tubers) Dissin’ My Dead Drops? Drawing conclusions about human nature based upon a small spike in YouTube comments is maybe as questionable as predicting election results based on polls. But hey, this is my data! For a likely inexplicable reason, I have gotten a small burst of comments recently on one of my YouTube videos (a burst on my videos […] &amp#x27A1;
  • 2015
    • One Photo. Zero Paradoxes. Or Many. Warning: This blog post inspired by of all things a ‘favorite’ of a photo, and is being written without too much direction where it will go. This is just one photo of mine. Someone recently favorited it in flickr (apparently Yahoo has not gotten the Twitter notice that Likes are the thing). For whatever inexplicable […] &amp#x27A1;
  • 2014
    • Creative Commons Ought to Travel With the Media From some banter via twitter this morning with Clint Lalonde and Pat Lockley, it occurred to me a great challenge to Creative Commons is that the license is metadata that is usually separated from the content it refers too– e.g. it is extra code in a web page, or additional information stored with a photo […] &amp#x27A1;
    • The Little Things I’ve been grateful for the deluxe accommodations that has been provided for my fourth month visit at Thompson Rivers University. I’m on the fancy floor of suites, above 10 floors of student residences. The floor I am on (I think) they run out of their Hospitality program, so there are students in that program working […] &amp#x27A1;
  • 2013
    • YAOOCS (Yet Another Open Online Course Started)… cc licensed ( BY NC SA ) flickr photo shared by Since EBCDIC Move along. I thought this course would be The One. The One I Finished. It’s not the course’s fault at all, it’s all PEBKAC. I was eager to dive into the P2PU course Play With Your Music: “Play With Your Music” is […] &amp#x27A1;
  • 2011
    • Why Does Google Obscure Searches for Content Licensed for Re-use? Not unlike the scared question of how many licks does it take to get to the center of a Tootsie Pop, I just counted six clicks needed to do a Google Image search for content that is licensed for reuse. Six. Here we go. (1) Go to Google image search. It has that new sparse […] &amp#x27A1;
    • Open Courses / Open Minds I did not catch the stream of the ds106 presentation at the CUNY conference by Mikhail Gershovich and Michael Branson-Smith, so I did not hear their response- but Mikhail’s tweet bemused me: Amusing because who can really say what a University “feels”? Nah. It really shows how thin the understanding is of an open course, […] &amp#x27A1;
    • (Late) Book Report: The Legend of Colton H. Bryant The Legend of Colton H. Bryant was a book that Barbara Ganley recommended when I was in the first legs of my road odyssey, because of its setting in Wyoming where I was traversing. Of course, I had to follow the suggestion, and had downloaded it to my Kindle on my iPad… where it languished […] &amp#x27A1;
  • 2010
    • From Cape Town OER to Spanish Journal Article: Newest Amazing Story Here is my newest Amazing Story of Sharing of 2010 (not THE newest, because they are happening all the time). Last week I wrote of an unsolicited message from Michael Paskevicius of the University of Cape Town OER Project, eager to share the story of an open resource shared by Matumo Ramafikeng, a teacher at […] &amp#x27A1;
  • 2009
    • Dive into Dogs Over this morning’s coffee I was rummaging around my flickr stats. Yum, stats. If you have never done this, there is an incredible amount if interesting information you can find there, like I have no idea why there was a spike of 2000+ views on November 22. Or you can find which of your photos […] &amp#x27A1;
  • 2004
    • Sony Stomps on Kottke Bloggers can start feeling like their voice is powerful, but the power may be vaporized in the face of multibillion dollar companies. Jason Kottke, who has had a great running fascination with Ken Jenning’s wild Jeopardy marathon, apparently is being threatened by Sony (who owns the show and likely 1/3 of the planet) is spanking […] &amp#x27A1;
    • Is eBay Customer ‘Service’ Smokin’ Crack? If you think I get overly torqued about spammers, poor web site from big entities and doofus customer service is right up there as well. I continually deal with some online banking and bill paying service that works marvelously, and yet fight others (hello CitiBank) that offer “service” that is browser dependent or completely dysfunctional. […] &amp#x27A1;
  • 2003
    • “Where have all the bloggers gone?” Cue the folk music, Pete… Where have all the bloggers gone? Long time passing. Where have all the bloggers gone? Long time ago. Where have all the bloggers gone? Spammers have picked them ev’ry one. Oh, when will you ever learn? Oh, when will you ever learn? My RSS reader stays pretty grey these days. […] &amp#x27A1;
    • Does Rackspace.com coddle Spam Roaches? I thought I really had nailed a blog spammer by tracking down the internet provider, documenting, and submitting all the information to the appropriate abuse contact. What I got in return was zilch. Why would an internet provider protect me from spammers? They might be paying customers and I am not.  Share this barking on […] &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 *