“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 14 posts previously published on September 7th

  • 2020
    • If Anyone Gets My Concept of Public Domain, It’s Musicians In my best Rod Serling intonation, “Submitted for your approval, two different musicians, never having made contact, both express appreciation and credit for shared public domain photos, and offer thanks despite the general understanding of said licenses are that you do not have to attribute…” A direct message came to me in instagram, and it’s […]
  • 2015
    • Connecting The Seemingly Disconnected I so adore Maria Popova’s Brain Pickings though she is so prolific, my reading is always lagging. But the weekly summary in my email, jaunted me to read The American Scholar: Emerson’s Superb Speech on the Life of the Mind, the Art of Creative Reading, and the Building Blocks of Genius. The reason being the […]
  • 2014
    • Driving Around Almost Four Corners creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog My return home Friday was a 10 day, 1500 mile loop originally planned to cross through all of the Four Corners States. Sorry Utah, I ended up cutting you out, but I still love your sandstone canyon lands. This was somewhat of a dress […]
  • 2011
    • Tweet Like Phillips Seafood Just to prove to Andy Rush that you can publish from storify to your own blog and have all the content there. This was done with the One-click publishing at storify that I connected to my blog. This is how a business can make a customer feel valued- tweeting back in a way that you […]
  • 2010
    • Spam Libs cc licensed flickr photo shared by AlyssssylA I get about one of these a day. I guess there is a giant “SUCKER” sign pasted on the back of me on the internet. Do you think it is that hard to spot a machine generated body of text? C’mon, I did Mad Libs in the 1970s. […]
    • Bye-bye flickr cc BY Hello BY-NC It was back in late 2006 I switched my flickr photo creative commons license to the simple, and sharable, by attribution license. I said then: So I am considering, pondering, swaying that the most free, is the simple BY Attribution license, and until someone strongly can compel me backward, have switched this on my blog […]
  • 2009
    • I’m Running. And Nagging. You’ve Been Forewarned. re-posted from I Hate Running… cc licensed flickr photo shared by swissrolli With a week of successful training under my ….. well I don’t wear a belt while running, so there goes the metaphor. But I am feeling ready to put the running shoes on for the next 20 weeks of training leading up to […]
  • 2005
    • Everything Steve Johnson Writes About is Bad For You … which is a good thing. Steven Johnson‘s book Everything Bad Is Good For You has been out, and blogged about, for a while. I finally had a chance to read it over Labor Day, and have come away amazed at how fresh a view it is on pop culture, games, and even reality TV. […]
  • 2004
    • Spammers Never Rest Sigh. The wiki euphoria may be short lived. I’ve just wiped out a pile of link insertions from a pile of weird Chinese web sites from some of our Ocotillo wikis. Sure, I can remove them and ad some IPs to the banned list, but that approach surely will not scale. Over the weekend, there […]
    • Reusable Ideas, not Objects: Pop Culture Bingo More on the MLX front. An item that came in recently got me thinking more so about the value of reusable ideas- sure it is great to have some complex, engaging Flash animated do-hickey, but what great teachers have in great volume, and worth sharing, are smaller gems of great re-usable teaching ideas. So take […]
    • The Next (and Last?) Great MLX Package Race For the last two years we have tried a myriad of methods for soliciting people in our system to contribute their teaching ideas, class activities, course materials, heck even “learning objects” to our Maricopa Learning eXchange (MLX) (see more about our incentive methods) Even getting closer to the 1000 item mark, I know for sure […]
    • Missed Utah I sure regret not having time to make the Instructional Technology Institute at Utah State University apparently well orchestrated by David Wiley and nicely blogged by others. The blog buzz is good from folks I know and trust. I’ve got some blog scraping to catch up on. Some wishes: Earlier Notice. It was announced like […]
    • To the Coast and Back Ahh, and end to the lack of blog labor for an extended Labor Day weekend in San Diego. Over there, the refer to us invaders from the east as “Zonies. Some highlights included: Excellent Mexican food at a little place in Blythe, CA (we drove out the LA way to visit family south of Riverside) […]
  • 2003
    • Some Changes around the CDB dog house I’ve been tinkering a bit with the site here- getting into adding new MovableType templates and moving commonly used code pieces into modules, but more or less, this is mild hacking away until it works. The additions include some new categories: * MLX – about the Maricopa Learning eXchange) * RSS – all the stuff […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 14 posts previously published on September 7th

  • 2020
    • If Anyone Gets My Concept of Public Domain, It’s Musicians In my best Rod Serling intonation, “Submitted for your approval, two different musicians, never having made contact, both express appreciation and credit for shared public domain photos, and offer thanks despite the general understanding of said licenses are that you do not have to attribute…” A direct message came to me in instagram, and it’s […] &amp#x27A1;
  • 2015
    • Connecting The Seemingly Disconnected I so adore Maria Popova’s Brain Pickings though she is so prolific, my reading is always lagging. But the weekly summary in my email, jaunted me to read The American Scholar: Emerson’s Superb Speech on the Life of the Mind, the Art of Creative Reading, and the Building Blocks of Genius. The reason being the […] &amp#x27A1;
  • 2014
    • Driving Around Almost Four Corners creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog My return home Friday was a 10 day, 1500 mile loop originally planned to cross through all of the Four Corners States. Sorry Utah, I ended up cutting you out, but I still love your sandstone canyon lands. This was somewhat of a dress […] &amp#x27A1;
  • 2011
    • Tweet Like Phillips Seafood Just to prove to Andy Rush that you can publish from storify to your own blog and have all the content there. This was done with the One-click publishing at storify that I connected to my blog. This is how a business can make a customer feel valued- tweeting back in a way that you […] &amp#x27A1;
  • 2010
    • Spam Libs cc licensed flickr photo shared by AlyssssylA I get about one of these a day. I guess there is a giant “SUCKER” sign pasted on the back of me on the internet. Do you think it is that hard to spot a machine generated body of text? C’mon, I did Mad Libs in the 1970s. […] &amp#x27A1;
    • Bye-bye flickr cc BY Hello BY-NC It was back in late 2006 I switched my flickr photo creative commons license to the simple, and sharable, by attribution license. I said then: So I am considering, pondering, swaying that the most free, is the simple BY Attribution license, and until someone strongly can compel me backward, have switched this on my blog […] &amp#x27A1;
  • 2009
    • I’m Running. And Nagging. You’ve Been Forewarned. re-posted from I Hate Running… cc licensed flickr photo shared by swissrolli With a week of successful training under my ….. well I don’t wear a belt while running, so there goes the metaphor. But I am feeling ready to put the running shoes on for the next 20 weeks of training leading up to […] &amp#x27A1;
  • 2005
    • Everything Steve Johnson Writes About is Bad For You … which is a good thing. Steven Johnson‘s book Everything Bad Is Good For You has been out, and blogged about, for a while. I finally had a chance to read it over Labor Day, and have come away amazed at how fresh a view it is on pop culture, games, and even reality TV. […] &amp#x27A1;
  • 2004
    • Spammers Never Rest Sigh. The wiki euphoria may be short lived. I’ve just wiped out a pile of link insertions from a pile of weird Chinese web sites from some of our Ocotillo wikis. Sure, I can remove them and ad some IPs to the banned list, but that approach surely will not scale. Over the weekend, there […] &amp#x27A1;
    • Reusable Ideas, not Objects: Pop Culture Bingo More on the MLX front. An item that came in recently got me thinking more so about the value of reusable ideas- sure it is great to have some complex, engaging Flash animated do-hickey, but what great teachers have in great volume, and worth sharing, are smaller gems of great re-usable teaching ideas. So take […] &amp#x27A1;
    • The Next (and Last?) Great MLX Package Race For the last two years we have tried a myriad of methods for soliciting people in our system to contribute their teaching ideas, class activities, course materials, heck even “learning objects” to our Maricopa Learning eXchange (MLX) (see more about our incentive methods) Even getting closer to the 1000 item mark, I know for sure […] &amp#x27A1;
    • Missed Utah I sure regret not having time to make the Instructional Technology Institute at Utah State University apparently well orchestrated by David Wiley and nicely blogged by others. The blog buzz is good from folks I know and trust. I’ve got some blog scraping to catch up on. Some wishes: Earlier Notice. It was announced like […] &amp#x27A1;
    • To the Coast and Back Ahh, and end to the lack of blog labor for an extended Labor Day weekend in San Diego. Over there, the refer to us invaders from the east as “Zonies. Some highlights included: Excellent Mexican food at a little place in Blythe, CA (we drove out the LA way to visit family south of Riverside) […] &amp#x27A1;
  • 2003
    • Some Changes around the CDB dog house I’ve been tinkering a bit with the site here- getting into adding new MovableType templates and moving commonly used code pieces into modules, but more or less, this is mild hacking away until it works. The additions include some new categories: * MLX – about the Maricopa Learning eXchange) * RSS – all the stuff […] &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 *