“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 24 posts previously published on July 28th

  • 2021
    • It’s a CogDog Thing: Google Has Crossed The Line Adserving My Name We are literally frogs in the internet pan of water, with Google at al just incrementally turning up the surveillance capitalism flame every so gently that we just never notice the boil. So yes, it’s a tad creepy to see ads show up in say Instagram for products I have recently been searching for in […]
  • 2020
    • Leadership Site Wins a Bronze I’m allowed to brag a bit, right? Word came via email that a WordPress site I built last year for BC Corrections (hosted by and working with folks the Justice Institute of British Columbia) won a bronze prize from the Horizon Interactive Awards. I wrote several posts about the making of the BC Corrections Leadership […]
  • 2017
    • The Making of CogDog Shatner It’s been a while since I blogged a breakdown on the making of a DS106 Daily Create. I was lagging a bit on energy this afternoon, and that’s when I see if I can publish a Daily Create response in less than an hour. TDC2027 was a fun one: #tdc2027 Shatner A Song: William Shatner, […]
    • Revving up the Theme Copy Machine to Produce the Daily Extend Maybe I just keep cranking out the copy web sites. If you invite me on to aproject chances are I will make a case to do something derivative of DS106 — maybe it’s blog aggregation or some kind of bank. But the one I love the most is introducing the Daily Blank, a WordPress theme […]
    • Garden Fails and Compost Success Beyond photos and dog walks, maybe the most enjoyable thing I do away from the keyboard is working in my yard, my 1/3 of an acre of land. I have done a lot this year after expanding the fence to the whole tard, making stone walkways, “wee walls” and new leveled out areas for plants […]
  • 2016
    • Relighting Thimble and the ImageSeek Teaching Kit I’ve been a big fan of Mozilla’s Webmaker tools since they came out– Popcorn video editor, Xray Goggles to remix web pages, and Thimble as a web editor that lets you learn code while seeing what it does. In 2013 I did some work with them to create some demonstration projects – Ingredients of Me […]
    • Granny’s Stories– from Audio Tape to TapeWrite Way back in the paleolithic web era (1994) on a visit to where I grew up in Baltimore, I made some audio recordings of my grandmother sharing stories of her life. These were recorded on a dictation microcasette, but as she had passed away in 2003, I’ve been very very pleased I captured her voice. […]
  • 2015
    • On Crappy License Conditions Recently I was looking for poop. Well, a photo of it. For a blog post. Using Google Image search restricted to media licensed to share, I found a worthy image on Wikimedia Commons. I was about to use it, and then I read the details of the license: This file (photograph, motion picture, graphic or […]
    • The UdG Agora Project (part 1 of ∞) I do not know where to begin writing. Back when I was just a puppy of a blogger, I’d document almost every session of a conference. I look at this empty WordPress editing screen trying to figure how to describe the last two weeks spent in Guadalajara in the perhaps the most intense and most […]
  • 2014
    • Feed WordPress 101: A Few More Tricks For Your Site This is part 5 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 recombined Feeding […]
    • I Don’t Like Beets or Facebook It’s been a month since I drove a stake through the heart of my Facebook account. Life feels pretty much the same. My process was not the most well thought out- I posted a status, and nuked the account an hour later, so who knows what replies I missed? My sister claims she saw a […]
  • 2013
    • ds106 Daily Create Challenge (28): I’m Falling Today’s ds106 Daily Create was another video one, these are the kind that make the weak run for the hills crying “Mommy! Video is so complicated…” Make a stop motion movie that brings something to life in a unique way. I actually may have never done a stop motion video before, so that’s why I […]
  • 2011
    • Road Stats: Week 5 cc licensed ( BY ) flickr photo shared by cogdogblog Number of days on the road: 35 Miles Driven: 3790 Number of States driven in: 6 Number of Islands Slept On: 1 (Whidbey Island, WA) Money spent on gas: $793.40 Photos posted: 882 (that is an average of 25.2 per day) ds106 Mile marker Photos: […]
  • 2009
    • I Can Haz DataBaze? cc licensed flickr photo shared by cogdogblog They do. I want the world to know. (this is an hour after my second request submitted to their support email for help) Twas not a happy experience last 2 days with Dreamhost and a migration to their “private server” experience…. I had not responded to their first […]
  • 2008
    • Wordle Does Feeds Wordle Does Feeds by cogdogblog posted 28 Jul ’08, 10.57am MDT PST on flickr The uber nifty Wordle tag cloud generator now can take any URL that has an RSS feed and generate one of those lovely word maps of content. Here is what the latest blabber from CogDogBlog has in it- heavily weighted by […]
    • Help Me Sort our Drupal Taxonomy Mess Calling drupal jedi masters! I need some advice. When planning the structure of the NMC web site I had only a fuzzy idea of how to use taxonomies for organizing content, and ended up creating one taxonomy for staff to organize content that is a bit problematic as it serves multiple purposes, and I want […]
    • Lopsided Choices, Eeyore, Tigger, WikiPedia? As a kid I was immersed in the House by Pooh Corner it was the ancient “book” technology and a few 72 rpm LPs of someone reading the stories. I did not have too many of the accessory toys, maybe an inflatable set of characters. I really wanted a heffalump. The stream of memories was […]
  • 2006
    • Odeo Now Has Audio Segments URL Addressable (Sort of?) Just as Tim noted Google Video is making it so we can pick an arbitrary start point to play a video clip, now you can do the same with audio clips on Odeo: Someone send me an email asking how to link to a specific part of a podcast in Odeo, which is a little-known […]
  • 2005
    • I’ve Stopped Furling It was getting tedious, even with my own multi-site bookmarklet tool, to load web sites I have scanned into both furl and del.icio.us— especially as Firefox seemed to 60% of the time lose track of the Furl content. It’s nothing wrong with Furl, I like the service, and it has most of the hooks I […]
    • Googly Home Google is certainly sitting idly by while Yahooo ramps up its personal services. Check out the new Google personal home page, where you can select from a number of RSS sources, or connect your own: This was a quick set up with some of my own feeds, important weather selections, and a few of the […]
    • Flicking The Switch AS an FYI, this blog, Feed2JS, and every other thing internet originating at Maricopa will be going offline Saturday July 30, from 7:00 Am to Noon (PST). They are needing to do major electrical upgrades to the main server room, and thus not only are web servers going down, so is email, phone, and internet […]
  • 2004
    • Tom, Here’s an Interface for Ya! Tom Hoffman, blogther (=”blog+author”, eh?) of Tuttle SVC wrote today about an interest in two-person interfaces: What occurred to me is that there are lots of jobs in real life where you have two people collaboratively operating one machine or even one set of data on paper, but I can’t think of a single pc-based […]
    • One More Flickr-y Post flickr foto Pass the Suflur, Pleaseavailable on my flickr Most folks who have been to the Vancouver waterfront have likely marveled at this yellow mound- a ferry ride, a lot of pixels, and some cropping got me a nice closeup. I have dinkered away a bit more time than I would have preferred to set […]
    • Blogging Photos FROM Flickr flickr foto On the Waterfrontavailable on my flickr A nice day in the harbour of bustling Ucluelet, on the west coast of Vancouver Island. Remarkly, when I told Canadians I visited Ucluelet (which took a week to learn the correct pronounciation), they invariable smiled and said, “Ah, Tofino” (which, while nearby, is a completely different […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 24 posts previously published on July 28th

  • 2021
  • 2020
    • Leadership Site Wins a Bronze I’m allowed to brag a bit, right? Word came via email that a WordPress site I built last year for BC Corrections (hosted by and working with folks the Justice Institute of British Columbia) won a bronze prize from the Horizon Interactive Awards. I wrote several posts about the making of the BC Corrections Leadership […] &amp#x27A1;
  • 2017
    • The Making of CogDog Shatner It’s been a while since I blogged a breakdown on the making of a DS106 Daily Create. I was lagging a bit on energy this afternoon, and that’s when I see if I can publish a Daily Create response in less than an hour. TDC2027 was a fun one: #tdc2027 Shatner A Song: William Shatner, […] &amp#x27A1;
    • Revving up the Theme Copy Machine to Produce the Daily Extend Maybe I just keep cranking out the copy web sites. If you invite me on to aproject chances are I will make a case to do something derivative of DS106 — maybe it’s blog aggregation or some kind of bank. But the one I love the most is introducing the Daily Blank, a WordPress theme […] &amp#x27A1;
    • Garden Fails and Compost Success Beyond photos and dog walks, maybe the most enjoyable thing I do away from the keyboard is working in my yard, my 1/3 of an acre of land. I have done a lot this year after expanding the fence to the whole tard, making stone walkways, “wee walls” and new leveled out areas for plants […] &amp#x27A1;
  • 2016
    • Relighting Thimble and the ImageSeek Teaching Kit I’ve been a big fan of Mozilla’s Webmaker tools since they came out– Popcorn video editor, Xray Goggles to remix web pages, and Thimble as a web editor that lets you learn code while seeing what it does. In 2013 I did some work with them to create some demonstration projects – Ingredients of Me […] &amp#x27A1;
    • Granny’s Stories– from Audio Tape to TapeWrite Way back in the paleolithic web era (1994) on a visit to where I grew up in Baltimore, I made some audio recordings of my grandmother sharing stories of her life. These were recorded on a dictation microcasette, but as she had passed away in 2003, I’ve been very very pleased I captured her voice. […] &amp#x27A1;
  • 2015
    • On Crappy License Conditions Recently I was looking for poop. Well, a photo of it. For a blog post. Using Google Image search restricted to media licensed to share, I found a worthy image on Wikimedia Commons. I was about to use it, and then I read the details of the license: This file (photograph, motion picture, graphic or […] &amp#x27A1;
    • The UdG Agora Project (part 1 of ∞) I do not know where to begin writing. Back when I was just a puppy of a blogger, I’d document almost every session of a conference. I look at this empty WordPress editing screen trying to figure how to describe the last two weeks spent in Guadalajara in the perhaps the most intense and most […] &amp#x27A1;
  • 2014
    • Feed WordPress 101: A Few More Tricks For Your Site This is part 5 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 recombined Feeding […] &amp#x27A1;
    • I Don’t Like Beets or Facebook It’s been a month since I drove a stake through the heart of my Facebook account. Life feels pretty much the same. My process was not the most well thought out- I posted a status, and nuked the account an hour later, so who knows what replies I missed? My sister claims she saw a […] &amp#x27A1;
  • 2013
    • ds106 Daily Create Challenge (28): I’m Falling Today’s ds106 Daily Create was another video one, these are the kind that make the weak run for the hills crying “Mommy! Video is so complicated…” Make a stop motion movie that brings something to life in a unique way. I actually may have never done a stop motion video before, so that’s why I […] &amp#x27A1;
  • 2011
    • Road Stats: Week 5 cc licensed ( BY ) flickr photo shared by cogdogblog Number of days on the road: 35 Miles Driven: 3790 Number of States driven in: 6 Number of Islands Slept On: 1 (Whidbey Island, WA) Money spent on gas: $793.40 Photos posted: 882 (that is an average of 25.2 per day) ds106 Mile marker Photos: […] &amp#x27A1;
  • 2009
    • I Can Haz DataBaze? cc licensed flickr photo shared by cogdogblog They do. I want the world to know. (this is an hour after my second request submitted to their support email for help) Twas not a happy experience last 2 days with Dreamhost and a migration to their “private server” experience…. I had not responded to their first […] &amp#x27A1;
  • 2008
    • Wordle Does Feeds Wordle Does Feeds by cogdogblog posted 28 Jul ’08, 10.57am MDT PST on flickr The uber nifty Wordle tag cloud generator now can take any URL that has an RSS feed and generate one of those lovely word maps of content. Here is what the latest blabber from CogDogBlog has in it- heavily weighted by […] &amp#x27A1;
    • Help Me Sort our Drupal Taxonomy Mess Calling drupal jedi masters! I need some advice. When planning the structure of the NMC web site I had only a fuzzy idea of how to use taxonomies for organizing content, and ended up creating one taxonomy for staff to organize content that is a bit problematic as it serves multiple purposes, and I want […] &amp#x27A1;
    • Lopsided Choices, Eeyore, Tigger, WikiPedia? As a kid I was immersed in the House by Pooh Corner it was the ancient “book” technology and a few 72 rpm LPs of someone reading the stories. I did not have too many of the accessory toys, maybe an inflatable set of characters. I really wanted a heffalump. The stream of memories was […] &amp#x27A1;
  • 2006
    • Odeo Now Has Audio Segments URL Addressable (Sort of?) Just as Tim noted Google Video is making it so we can pick an arbitrary start point to play a video clip, now you can do the same with audio clips on Odeo: Someone send me an email asking how to link to a specific part of a podcast in Odeo, which is a little-known […] &amp#x27A1;
  • 2005
    • I’ve Stopped Furling It was getting tedious, even with my own multi-site bookmarklet tool, to load web sites I have scanned into both furl and del.icio.us— especially as Firefox seemed to 60% of the time lose track of the Furl content. It’s nothing wrong with Furl, I like the service, and it has most of the hooks I […] &amp#x27A1;
    • Googly Home Google is certainly sitting idly by while Yahooo ramps up its personal services. Check out the new Google personal home page, where you can select from a number of RSS sources, or connect your own: This was a quick set up with some of my own feeds, important weather selections, and a few of the […] &amp#x27A1;
    • Flicking The Switch AS an FYI, this blog, Feed2JS, and every other thing internet originating at Maricopa will be going offline Saturday July 30, from 7:00 Am to Noon (PST). They are needing to do major electrical upgrades to the main server room, and thus not only are web servers going down, so is email, phone, and internet […] &amp#x27A1;
  • 2004
    • Tom, Here’s an Interface for Ya! Tom Hoffman, blogther (=”blog+author”, eh?) of Tuttle SVC wrote today about an interest in two-person interfaces: What occurred to me is that there are lots of jobs in real life where you have two people collaboratively operating one machine or even one set of data on paper, but I can’t think of a single pc-based […] &amp#x27A1;
    • One More Flickr-y Post flickr foto Pass the Suflur, Pleaseavailable on my flickr Most folks who have been to the Vancouver waterfront have likely marveled at this yellow mound- a ferry ride, a lot of pixels, and some cropping got me a nice closeup. I have dinkered away a bit more time than I would have preferred to set […] &amp#x27A1;
    • Blogging Photos FROM Flickr flickr foto On the Waterfrontavailable on my flickr A nice day in the harbour of bustling Ucluelet, on the west coast of Vancouver Island. Remarkly, when I told Canadians I visited Ucluelet (which took a week to learn the correct pronounciation), they invariable smiled and said, “Ah, Tofino” (which, while nearby, is a completely different […] &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 *