“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 17 posts previously published on March 27th

  • 2019
    • Please TRU Write With Me, I’m All Shiny And New What’s wrong around here? It’s been maybe a month since I’ve blogged about SPLOTs. Some might speculate it’s the cold here, but quite the opposite, the hands have been very warm, working deep in the code. There were some wild sparks when I cracked an issue in SPLOTs like TRU Writer, TRU Collector, and SPLOTbox […]
  • 2017
    • A David Reading File this as another lesson in being part of the Networked Narratives class — writing something personal is one thing, but reading it out loud another, and the third (still on my list) yet beyond that. This again like we are finding this course, is something that happens when we let loose a little from […]
  • 2015
    • The 60,000 Times Faster Claim Gets Dialed Back to 1982 Did you realize that we can process visuals 60,000 times faster than text? There is something about that phrase that people just keep slapping it into presentations, blog posts about infographics, newspaper articles, published books about visual literacy. Google finds 195,000 references to it. The problem is that it’s bogus. There is bubkas for anything […]
  • 2013
    • Get yer Scottlo Oats I could not pass up this tweet https://twitter.com/scottlo/status/317153027092013056 to customize the box of oats I cannot get enough of these. Dig the Saudo kilt on that dude.  Share this barking on social media
  • 2012
    • 5 Cops 5 Seconds For the ds106 assignment One Archetype, Five Movies, Five Seconds Create a five second video of one archetype from five different movies cutting together one second of each. Examples could include: Prisoners, Thieves, Beauty Queens, Kings, Robin Hoods, James Bonds, Bank Robbers, Assassins, Bad Boys, Kung Fu Masters, Femme Fatales, Sports Heroes, High School Bullies, […]
  • 2011
    • Sharing Movie Lists from IMDb cc licensed ( BY NC SD ) flickr photo shared by Profound Whatever One of my long time favorite web site references is the Internet Movie Database (IMDb), not only because of its comprehensive depth and breadth of information about movies and TV shows, but also because it is rich in data- you can go […]
  • 2010
    • The Whole, the Parts, and that Kick Ass Porcupine cc licensed flickr photo shared by ice.bluess This week’s reading for Gardner Campbell’s New Media Faculty Seminar was video artist Bill Viola’s “Will There Be Condominiums in Data Space?” a title that intrigued me and, even as Gardner explained it on our podcast, I’m still circling around its meaning. For whatever reason, I keep coming […]
    • Totally Completely Original This speaks for itself 😉 I’m lining up now for tickets.  Share this barking on social media
  • 2009
    • Fear of Googled Past cc licensed flickr photo by Photography by Chris Rob Wall’s excellent post on Unintended Consequences pinged me recently (Rob, you gotta stop selling yourself short on your writing, ok?). In reading it, however, a phrase I have read like a thousand times before, maybe even said myself, jumped out and get stuck in my fur: […]
    • Emptied Anticipation Emptied Anticipation by cogdogblog posted 27 Mar ’09, 8.29pm MDT PST on flickr Most every day I walk the one quarter mile walk to my mailbox. I have two choices of routes, and usually take the other back. I should know every detail of the way, but in search today of my 2009/365 photo, I […]
  • 2008
    • Squirrel + Dog + = I have documented the hungry actions of the squirrels who raid my bird feeders and again. Fresa, the cutest beagle in the world just gets wild when she spots the squirrel, and gets riles up in chase/hunt mode. As I just got my Canon Powershot back from repair, I was equipped today to […]
  • 2006
    • Nice Bark For Customer Service In the past I have used this space to vent about experiences with bad customer service (phone trees, bad online help systems, etc), so it is only fair to report a positive experience. This morning I called Qwest to set up phone lines and internet service for my home office to be ready when I […]
    • Get Thee To a Hard Drive flickr foto Another Project, Another Dayavailable on my flickr This stack of 70+ CDs now hides in my home office closet. It represents my archive of personal photos going back to maybe 2000. Since iPhoto (older version) gets fussy with more than 500 photos, and is really groaning the drive on my old 700MhZ iBook […]
  • 2005
    • And de.liro.us Makes the Tool 12 An email from Steve Cohen resulted in adding the 12th site, de.lirio.us to the Site Submission MultiTool— now you can pick and chose from a dozen different we site bookmarking sites, and build a single browser link bar tool to send sites to any or all of the 12 you like to use. Make your […]
    • Oh What a Tangled Web We Tag The folksonomy – contralled vocabulary debates surge and sputter… Recently David Weinberger went “back and forth” on this: This is the promise and the risk of folksonomies. Folksonomies arise when people are tagging objects (Web pages, photos, etc.) in public. If you want something to be found by others, you’ll choose the most popular tag. […]
    • Pondering the Blog Change I’m mulling over what many other quicker, maybe wiser, colleagues have done, and migrate my blog software from MovableType 2.661 to WordPress 1.5. It’s not critical, not urgent, but I feel it nagging at me. Last week I dumped a chunk of time trying to get all the perl pieces in place to use the […]
    • Let’s Go to the Dump More irrelevant updates on the home landscaping projects… when we bought our house in 1997, landscaping was a process of adding plants (as there was almost nothing growing here except for a few trees)… 8 years later we are in the process of taking out as much of the desert plants we put in… have […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 17 posts previously published on March 27th

  • 2019
    • Please TRU Write With Me, I’m All Shiny And New What’s wrong around here? It’s been maybe a month since I’ve blogged about SPLOTs. Some might speculate it’s the cold here, but quite the opposite, the hands have been very warm, working deep in the code. There were some wild sparks when I cracked an issue in SPLOTs like TRU Writer, TRU Collector, and SPLOTbox […] &amp#x27A1;
  • 2017
    • A David Reading File this as another lesson in being part of the Networked Narratives class — writing something personal is one thing, but reading it out loud another, and the third (still on my list) yet beyond that. This again like we are finding this course, is something that happens when we let loose a little from […] &amp#x27A1;
  • 2015
    • The 60,000 Times Faster Claim Gets Dialed Back to 1982 Did you realize that we can process visuals 60,000 times faster than text? There is something about that phrase that people just keep slapping it into presentations, blog posts about infographics, newspaper articles, published books about visual literacy. Google finds 195,000 references to it. The problem is that it’s bogus. There is bubkas for anything […] &amp#x27A1;
  • 2013
    • Get yer Scottlo Oats I could not pass up this tweet https://twitter.com/scottlo/status/317153027092013056 to customize the box of oats I cannot get enough of these. Dig the Saudo kilt on that dude.  Share this barking on social media &amp#x27A1;
  • 2012
    • 5 Cops 5 Seconds For the ds106 assignment One Archetype, Five Movies, Five Seconds Create a five second video of one archetype from five different movies cutting together one second of each. Examples could include: Prisoners, Thieves, Beauty Queens, Kings, Robin Hoods, James Bonds, Bank Robbers, Assassins, Bad Boys, Kung Fu Masters, Femme Fatales, Sports Heroes, High School Bullies, […] &amp#x27A1;
  • 2011
    • Sharing Movie Lists from IMDb cc licensed ( BY NC SD ) flickr photo shared by Profound Whatever One of my long time favorite web site references is the Internet Movie Database (IMDb), not only because of its comprehensive depth and breadth of information about movies and TV shows, but also because it is rich in data- you can go […] &amp#x27A1;
  • 2010
    • The Whole, the Parts, and that Kick Ass Porcupine cc licensed flickr photo shared by ice.bluess This week’s reading for Gardner Campbell’s New Media Faculty Seminar was video artist Bill Viola’s “Will There Be Condominiums in Data Space?” a title that intrigued me and, even as Gardner explained it on our podcast, I’m still circling around its meaning. For whatever reason, I keep coming […] &amp#x27A1;
    • Totally Completely Original This speaks for itself 😉 I’m lining up now for tickets.  Share this barking on social media &amp#x27A1;
  • 2009
    • Fear of Googled Past cc licensed flickr photo by Photography by Chris Rob Wall’s excellent post on Unintended Consequences pinged me recently (Rob, you gotta stop selling yourself short on your writing, ok?). In reading it, however, a phrase I have read like a thousand times before, maybe even said myself, jumped out and get stuck in my fur: […] &amp#x27A1;
    • Emptied Anticipation Emptied Anticipation by cogdogblog posted 27 Mar ’09, 8.29pm MDT PST on flickr Most every day I walk the one quarter mile walk to my mailbox. I have two choices of routes, and usually take the other back. I should know every detail of the way, but in search today of my 2009/365 photo, I […] &amp#x27A1;
  • 2008
    • Squirrel + Dog + = I have documented the hungry actions of the squirrels who raid my bird feeders and again. Fresa, the cutest beagle in the world just gets wild when she spots the squirrel, and gets riles up in chase/hunt mode. As I just got my Canon Powershot back from repair, I was equipped today to […] &amp#x27A1;
  • 2006
    • Nice Bark For Customer Service In the past I have used this space to vent about experiences with bad customer service (phone trees, bad online help systems, etc), so it is only fair to report a positive experience. This morning I called Qwest to set up phone lines and internet service for my home office to be ready when I […] &amp#x27A1;
    • Get Thee To a Hard Drive flickr foto Another Project, Another Dayavailable on my flickr This stack of 70+ CDs now hides in my home office closet. It represents my archive of personal photos going back to maybe 2000. Since iPhoto (older version) gets fussy with more than 500 photos, and is really groaning the drive on my old 700MhZ iBook […] &amp#x27A1;
  • 2005
    • And de.liro.us Makes the Tool 12 An email from Steve Cohen resulted in adding the 12th site, de.lirio.us to the Site Submission MultiTool— now you can pick and chose from a dozen different we site bookmarking sites, and build a single browser link bar tool to send sites to any or all of the 12 you like to use. Make your […] &amp#x27A1;
    • Oh What a Tangled Web We Tag The folksonomy – contralled vocabulary debates surge and sputter… Recently David Weinberger went “back and forth” on this: This is the promise and the risk of folksonomies. Folksonomies arise when people are tagging objects (Web pages, photos, etc.) in public. If you want something to be found by others, you’ll choose the most popular tag. […] &amp#x27A1;
    • Pondering the Blog Change I’m mulling over what many other quicker, maybe wiser, colleagues have done, and migrate my blog software from MovableType 2.661 to WordPress 1.5. It’s not critical, not urgent, but I feel it nagging at me. Last week I dumped a chunk of time trying to get all the perl pieces in place to use the […] &amp#x27A1;
    • Let’s Go to the Dump More irrelevant updates on the home landscaping projects… when we bought our house in 1997, landscaping was a process of adding plants (as there was almost nothing growing here except for a few trees)… 8 years later we are in the process of taking out as much of the desert plants we put in… have […] &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 *