“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 May 31st

  • 2021
    • The New The blog keeps on keeping on, though I see in recent posting, there’s a lot of looking back, and one (well this one) can start worrying about being seen as too “back in the day” mindset. Time to flip the scopes (well there is a lingering draft of one more retro post). The old CogDogBlog […]
  • 2018
    • Hacking an Ontario Extend Visited Countries Map URL reading and deciphering skills, plus some brute force Javascript, had me two hours making an animation. These things get in my head and won’t let me rest until I spend a chunk of time in the rabbit holes. I entered this activity for yesterday’s Ontario Extend, a spawn of the DS106 Daily Create that […]
  • 2017
  • 2015
    • Monkeying Around With Hidden Flickr Search Parameters My long term infatuation with flickr may be my undoing… (skipping past the gripes about flickr’s design changes) (also skipping past whatever monkey goo that Google is offering for your photos) (anything else?). To me, what’s more important about flickr is what you do not see on the site or the (still partly crippled) mobile […]
  • 2012
    • Blogging Camp Macguffin Style The summer online version of ds106 that Martha Burtis and I are teaching is off like a rocket- but there is no reason why you cannot jump on board; just head over to Camp Magic Macguffin and follow the right side link to sign up. There is no worry about coming in later, although our […]
  • 2009
    • iSolar It was a while ago I blogged something about Doing Something Solar… I’ve not done a *whole* lot since then, but am planning on some research over the (sunny) summer on what it might take to rig some solar panels into my home grid. The folks at Connect2Earth were nice enough for doing something nice […]
    • Lies, Damn Lies, and MSN Search Statistics cc licensed flickr photo shared by cogdogblog From Microsoft’s Audience Intelligence adCenter Labs comes this tool for Demographics Prediction which claims it "predicts a user’s age, gender, and other demographic information, based on their online behavior, such as what queries they search online and what web sites they visit"– based on MSN search which is… […]
  • 2008
    • Horizon Report Preso a la Vuvox Collage I’m just back from a 3 day visit to St Paul for the Midwest Library Technology Conference hosted at Macalester College. This was the first time for this conference, and with attendance well over 250 and from the level of activity I observed, planner Ron Joslin and colleagues should be very pleased. I liked very […]
  • 2007
    • Google Maps Takin’ It to the Streets [View] I’m only one of billions who loves Google Maps. They find things, you can overlay satellite images. But what if you could really peek in an see what is there? Now you can* with the Street View option (*in limited areas). You can place a little icon person on the map, and get a fully […]
  • 2006
    • Playing Tag flickr foto Holding Handsavailable on flickr A fascinating sculpture outside a Department of Education building in Calgary My other web experiment today for the NMC Conference is setting up a page to provide some persuasion and aggregation for my goal of having participants “Tag This Conference”. The site I set up: http://www.nmc.org/events/2006summerconf/tag.php is aggregating the […]
    • Pretty Feeds Almost by definition, RSS, in its full XML glory, is ugly, and I have said before, “unsuitable for human eyes”. it is machine language, and there is no reason a person should look at it very long (geeks aside): But I’ve known in the back of my mind, it does not need to be so, […]
    • Tag This Conference flickr foto Cleveland Rocksavailable on flickr Rock and Roll Hall of Fame Next week, June 7-10, is the NMC Summer Conference, this year we are in Cleveland, hosted by a Fab Four of Case Western Reserve University, the Cleveland Institute of Art, the Cleveland Museum of of Art, and the Rock and Roll Hall of […]
    • Feed2JS Downloads Now With Podcast Media Support It was way overdue, but now our Feed2JS service and downloadable code now offers support for RSS feeds that contain links to podcast media– this means any RSS feed with RSS “enclosures” can now be rendered in any web page using our cut and paste code. Through a simple patch to the MagpieRSS parser library, […]
    • NAU Keynote Audio Just because Gardner asked for it (and in fact it was recorded), here is a low quality, 80 minute MP3 from the session Brian Lamb and I did in Flagstaff on Social Software (or as we called it, Tag Cloud frenzy): http://cogdogblog.com/wp-content/audio/nau06-keynote.mp3 [1:20:00 36.6 Mb MP3]  Share this barking on social media
  • 2005
    • Chainsaw Weekend (The Tool Metaphor) I find my life is full of metaphors, some fit well, others may be a stretch. Over the Memorial Day holiday weekend, I celebrated by doing yard work. Actually, after days of sitting at a computer, there is something very rewarding about doing sweaty, manual labor, doing something with your hands. On Sunday, we took […]
    • Scuttle n’ Jots: 2 More Social Bookmark Tools Furl and del.icio.us have lots of company- there seems to be no end in sight for the number of new sites offering a place for social bookmarking. I have just added two new tools of note (for a total of 15!) to my Multipost Bookmarklet Tool which allows you to select which services you use […]
  • 2004
    • Dave’s Definitive RSS Abbreviation The URL declares what RSS stands for? http://www.reallysimplesyndication.com/ peeked open just recently, Dave Winer’s effort (I llike the initial tone) to have a place to talk more about what RSS can do rather than what it stands for or the intracacies of XML. The revolution of RSS is what people are doing with it, what […]
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 May 31st

  • 2021
    • The New The blog keeps on keeping on, though I see in recent posting, there’s a lot of looking back, and one (well this one) can start worrying about being seen as too “back in the day” mindset. Time to flip the scopes (well there is a lingering draft of one more retro post). The old CogDogBlog […] &amp#x27A1;
  • 2018
    • Hacking an Ontario Extend Visited Countries Map URL reading and deciphering skills, plus some brute force Javascript, had me two hours making an animation. These things get in my head and won’t let me rest until I spend a chunk of time in the rabbit holes. I entered this activity for yesterday’s Ontario Extend, a spawn of the DS106 Daily Create that […] &amp#x27A1;
  • 2017
  • 2015
    • Monkeying Around With Hidden Flickr Search Parameters My long term infatuation with flickr may be my undoing… (skipping past the gripes about flickr’s design changes) (also skipping past whatever monkey goo that Google is offering for your photos) (anything else?). To me, what’s more important about flickr is what you do not see on the site or the (still partly crippled) mobile […] &amp#x27A1;
  • 2012
    • Blogging Camp Macguffin Style The summer online version of ds106 that Martha Burtis and I are teaching is off like a rocket- but there is no reason why you cannot jump on board; just head over to Camp Magic Macguffin and follow the right side link to sign up. There is no worry about coming in later, although our […] &amp#x27A1;
  • 2009
    • iSolar It was a while ago I blogged something about Doing Something Solar… I’ve not done a *whole* lot since then, but am planning on some research over the (sunny) summer on what it might take to rig some solar panels into my home grid. The folks at Connect2Earth were nice enough for doing something nice […] &amp#x27A1;
    • Lies, Damn Lies, and MSN Search Statistics cc licensed flickr photo shared by cogdogblog From Microsoft’s Audience Intelligence adCenter Labs comes this tool for Demographics Prediction which claims it "predicts a user’s age, gender, and other demographic information, based on their online behavior, such as what queries they search online and what web sites they visit"– based on MSN search which is… […] &amp#x27A1;
  • 2008
    • Horizon Report Preso a la Vuvox Collage I’m just back from a 3 day visit to St Paul for the Midwest Library Technology Conference hosted at Macalester College. This was the first time for this conference, and with attendance well over 250 and from the level of activity I observed, planner Ron Joslin and colleagues should be very pleased. I liked very […] &amp#x27A1;
  • 2007
    • Google Maps Takin’ It to the Streets [View] I’m only one of billions who loves Google Maps. They find things, you can overlay satellite images. But what if you could really peek in an see what is there? Now you can* with the Street View option (*in limited areas). You can place a little icon person on the map, and get a fully […] &amp#x27A1;
  • 2006
    • Playing Tag flickr foto Holding Handsavailable on flickr A fascinating sculpture outside a Department of Education building in Calgary My other web experiment today for the NMC Conference is setting up a page to provide some persuasion and aggregation for my goal of having participants “Tag This Conference”. The site I set up: http://www.nmc.org/events/2006summerconf/tag.php is aggregating the […] &amp#x27A1;
    • Pretty Feeds Almost by definition, RSS, in its full XML glory, is ugly, and I have said before, “unsuitable for human eyes”. it is machine language, and there is no reason a person should look at it very long (geeks aside): But I’ve known in the back of my mind, it does not need to be so, […] &amp#x27A1;
    • Tag This Conference flickr foto Cleveland Rocksavailable on flickr Rock and Roll Hall of Fame Next week, June 7-10, is the NMC Summer Conference, this year we are in Cleveland, hosted by a Fab Four of Case Western Reserve University, the Cleveland Institute of Art, the Cleveland Museum of of Art, and the Rock and Roll Hall of […] &amp#x27A1;
    • Feed2JS Downloads Now With Podcast Media Support It was way overdue, but now our Feed2JS service and downloadable code now offers support for RSS feeds that contain links to podcast media– this means any RSS feed with RSS “enclosures” can now be rendered in any web page using our cut and paste code. Through a simple patch to the MagpieRSS parser library, […] &amp#x27A1;
    • NAU Keynote Audio Just because Gardner asked for it (and in fact it was recorded), here is a low quality, 80 minute MP3 from the session Brian Lamb and I did in Flagstaff on Social Software (or as we called it, Tag Cloud frenzy): http://cogdogblog.com/wp-content/audio/nau06-keynote.mp3 [1:20:00 36.6 Mb MP3]  Share this barking on social media &amp#x27A1;
  • 2005
    • Chainsaw Weekend (The Tool Metaphor) I find my life is full of metaphors, some fit well, others may be a stretch. Over the Memorial Day holiday weekend, I celebrated by doing yard work. Actually, after days of sitting at a computer, there is something very rewarding about doing sweaty, manual labor, doing something with your hands. On Sunday, we took […] &amp#x27A1;
    • Scuttle n’ Jots: 2 More Social Bookmark Tools Furl and del.icio.us have lots of company- there seems to be no end in sight for the number of new sites offering a place for social bookmarking. I have just added two new tools of note (for a total of 15!) to my Multipost Bookmarklet Tool which allows you to select which services you use […] &amp#x27A1;
  • 2004
    • Dave’s Definitive RSS Abbreviation The URL declares what RSS stands for? http://www.reallysimplesyndication.com/ peeked open just recently, Dave Winer’s effort (I llike the initial tone) to have a place to talk more about what RSS can do rather than what it stands for or the intracacies of XML. The revolution of RSS is what people are doing with it, what […] &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 *