“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 12 posts previously published on October 26th

  • 2020
    • Aiming for the Joslin 50 Medal With a bit of uncertainty on the exact date, I am fairly sure tomorrow marks a milestone making me eligible to apply for a bronze medal from the Joslin Diabetes Center. That means making it to 50 years living with Type 1 Diabetes (at least doubling the scare tactic Dr Silver at Camp Glyndon tried […]
  • 2014
    • On the Road / Off the Road creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog From this perspective, actually laying down on Nevada highway 266, there is but one direction to go. I am the only person on the flickr using bellyontheroad as a tag; there is some sort of message there I won’t dwell too much upon. This […]
    • Clichés are Written 60,000 Times Faster Than Finding Sources creative commons licensed ( BY-NC-ND ) flickr photo shared by caddymob It’s time to start issuing citations for pooping on the internet. The sheer irony of what came in via a trackback (still value among the flotilla of spam) to my still un-solved pursuit to find the source, the actual credible source, for the oft […]
  • 2012
    • YouTube in An Alternate Universe of Niceness I’ve excited that we brought back the within the web storytelling assignment to ds106– the one where we ask students to use a browser tool to “re-edit” the content of an existing web site to give it a whole new meaning. IN many ways this subverts the web in a playful way that says, I […]
    • Daily Create for Kids? One of my favorite pieces of the ds106 fleet of awesome is The Daily Create – something we built together last year to provide a platform for regular creative challenges. While we use it within the ds106 courses taught at UMW, it is a low overhead way for people to participate in our (non-bovine) online […]
    • Five Card Stories with 8th Graders I was superexcited when Heather Durnin invited me to visit her grade 8 students in Wingham, Ontario, but the bonus was being able to connect her class with Clarence Fisher’s one up in Snowy River, Manitoba. This came togather over a few emails in the last 5 days, and we settled on a demo and […]
  • 2011
    • The Jim Groom Post Keynote Recap cc licensed ( BY NC SD ) flickr photo shared by giulia.forsythe As one of the converted, its hard not to be electrified after Jim’s keynote at Open Ed 2011– I can only guess what the energy was like in Park City. I was fortunate to be listening in with Gardner Campbell from his office […]
    • Are You [ds106] Experienced? This is a follow up on Gardner Campbell’s message last night when we did a ds106 radio show, echoed today by Jim Groom at his evangelistic Open Ed keynote. Gardner said something about “We dont need Open Education Resources, what we need are Open Education Experiences!” My thought now, given Jim’s passion (and all of […]
  • 2009
    • M*A*S*Hing the House Built on Multiple Choice Straw I wish I could remember that light bulb turning on moment when I realized succeeding in the school game had little to do with studying, knowledge, or intelligence– but learning how to score on multiple choice exams. My skills carried me through many standardized tests and college exams where I can really say I got […]
  • 2008
    • Rock the Academy The Video Inspired by the brilliant twitter love video by Martin I have been thinking of trying my hand at the craft, so here is a promo video for the upcoming NMC Online Symposium on Rock the Academy: Radical Teaching, Unbounded Learning. So I stretch the stereo type of “traditional” academy, but it’s all in fun. And […]
  • 2004
    • Back in Action (the photos are 404 for now) Just returned home from 5 days of being a sightseeing fool up and down the Rocky Mountains following last week’s EDUCAUSE conference in Denver. I’ve got a big of pile photos to flickr up, but it will be delayed following a harrowing experience having accidently leaving my digital camera at a restaurant in Colorado Springs, […]
  • 2003
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 12 posts previously published on October 26th

  • 2020
    • Aiming for the Joslin 50 Medal With a bit of uncertainty on the exact date, I am fairly sure tomorrow marks a milestone making me eligible to apply for a bronze medal from the Joslin Diabetes Center. That means making it to 50 years living with Type 1 Diabetes (at least doubling the scare tactic Dr Silver at Camp Glyndon tried […] &amp#x27A1;
  • 2014
    • On the Road / Off the Road creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog From this perspective, actually laying down on Nevada highway 266, there is but one direction to go. I am the only person on the flickr using bellyontheroad as a tag; there is some sort of message there I won’t dwell too much upon. This […] &amp#x27A1;
    • Clichés are Written 60,000 Times Faster Than Finding Sources creative commons licensed ( BY-NC-ND ) flickr photo shared by caddymob It’s time to start issuing citations for pooping on the internet. The sheer irony of what came in via a trackback (still value among the flotilla of spam) to my still un-solved pursuit to find the source, the actual credible source, for the oft […] &amp#x27A1;
  • 2012
    • YouTube in An Alternate Universe of Niceness I’ve excited that we brought back the within the web storytelling assignment to ds106– the one where we ask students to use a browser tool to “re-edit” the content of an existing web site to give it a whole new meaning. IN many ways this subverts the web in a playful way that says, I […] &amp#x27A1;
    • Daily Create for Kids? One of my favorite pieces of the ds106 fleet of awesome is The Daily Create – something we built together last year to provide a platform for regular creative challenges. While we use it within the ds106 courses taught at UMW, it is a low overhead way for people to participate in our (non-bovine) online […] &amp#x27A1;
    • Five Card Stories with 8th Graders I was superexcited when Heather Durnin invited me to visit her grade 8 students in Wingham, Ontario, but the bonus was being able to connect her class with Clarence Fisher’s one up in Snowy River, Manitoba. This came togather over a few emails in the last 5 days, and we settled on a demo and […] &amp#x27A1;
  • 2011
    • The Jim Groom Post Keynote Recap cc licensed ( BY NC SD ) flickr photo shared by giulia.forsythe As one of the converted, its hard not to be electrified after Jim’s keynote at Open Ed 2011– I can only guess what the energy was like in Park City. I was fortunate to be listening in with Gardner Campbell from his office […] &amp#x27A1;
    • Are You [ds106] Experienced? This is a follow up on Gardner Campbell’s message last night when we did a ds106 radio show, echoed today by Jim Groom at his evangelistic Open Ed keynote. Gardner said something about “We dont need Open Education Resources, what we need are Open Education Experiences!” My thought now, given Jim’s passion (and all of […] &amp#x27A1;
  • 2009
    • M*A*S*Hing the House Built on Multiple Choice Straw I wish I could remember that light bulb turning on moment when I realized succeeding in the school game had little to do with studying, knowledge, or intelligence– but learning how to score on multiple choice exams. My skills carried me through many standardized tests and college exams where I can really say I got […] &amp#x27A1;
  • 2008
    • Rock the Academy The Video Inspired by the brilliant twitter love video by Martin I have been thinking of trying my hand at the craft, so here is a promo video for the upcoming NMC Online Symposium on Rock the Academy: Radical Teaching, Unbounded Learning. So I stretch the stereo type of “traditional” academy, but it’s all in fun. And […] &amp#x27A1;
  • 2004
    • Back in Action (the photos are 404 for now) Just returned home from 5 days of being a sightseeing fool up and down the Rocky Mountains following last week’s EDUCAUSE conference in Denver. I’ve got a big of pile photos to flickr up, but it will be delayed following a harrowing experience having accidently leaving my digital camera at a restaurant in Colorado Springs, […] &amp#x27A1;
  • 2003
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 *