“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.
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.
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 June 7th
- 2022
- Where’s the Fediverse Shattering Kaboom? I have been lazy in not getting into the IndieWeb game here, but look who is catching up! I activate the Activity Pub plugin but no idea how it knows who I am in Mastodon- this post gave me the clue that is not listed elsewhere- in my WordPress profile at the bottom is a […]
- 2021
- The Magic/Vagary of Google Search We use it so frequently that perhaps we do not marvel that web search works. Especially the one where the brand name becomes the verb. In that googling something, typing a few words into a box, pressing a button, and getting a long stream of positive results. And of course “works” is the laden term […]
- 2018
- Connectively Full From First @ontarioextend Extended Lunch The first Ontario Extend Extended Lunch conversation was very filling. Thanks @ProfessorDannyS, @NurseKillam, @IrenequStewart, @Joanne_Kehoe for joining in. This was my idea to get to know participants and to listen to what they were interested in doing as part of my summer role facilitating the project for Terry Greene, who is again a dad (congrats!). […]
- 2012
- I Can’t GIF it Out of My System This has to stop, but not tonight. I missed the fun of the afternoon shit talking and gif smacking today. With some positive feedback on the last batch, I set out again to see what I could do with GIMP as a tool. For these next two I went for very original material, stuff you […]
- GIFfing with Jules Ok, Jim asked me to up the game, so I am going to get more particular about frame selection for my animated GIFs. We are working on the ds106 kickstarter awards for people who requested an animated GIF in their honor. I’ve got the task to do the one for Boone Gorges, who requested something […]
- GIF Pileup I’m so missing having a copy of Photoshop to work on; my limits now for doing animated GIFs are assembling images– Saving frames from MPEG Stream clip or a series of images form my DSLR, loading as layers into GIMP, and trying to make them flip as needed, I really miss how PhotoShop can try […]
- Evaluating the ds106 Evaluations cc licensed ( BY ) flickr photo shared by cogdogblog Most places I travel people ask me what it’s like working with Jim Groom and while it’s easy to reach for a wise crack (which I usually do), I have to frame this with a lot of awe for the spirit he brings to this […]
- 2011
- Me.Fool()=1 cc licensed ( BY NC SD ) flickr photo shared by Gary Denness I did something dumb on the internet. I should have known better. I should not have clicked. I should not have filled out the form. But, I did. The thing is, when you are cruising through the z-space, your 99.99% vigilance is […]
- 2008
- Spray Your Updates Everwhere with Ping.fm With my recent twitter screen shots I am showing my snark for sure. Yet, I am in no way advocating a rally for “let’s bail on twitter”. And to be honest, it really does not produce urine in my wheaties (as a variant of peeing in Cheerios for @fncil) when twitter goes down, out, or […]
- No Twitter? What to Do When You Can’t Get Your Twitter Fix by cogdogblog posted 7 Jun ’08, 6.07am MDT PST on flickr Newest thing to do whentwitterisdown.com Each click gives you a new idea… Like "Read a MF-ing book" Might be more fun that whentwitterisup.com thanks @mathplourde Share this barking on social media
- 2005
- Stopped Jots I was experimenting with the Jots.com bookmark and publish to weblog API, but as duly noted in comments by Will and James, it was turning my blog reading into more of a linkatorium: I’d rather get it by subbing your Jots feed rather than your blog feed. True, so I am shutting of the publishing […]
- Today’s Jots Movie mistakesgoofs, bloopers, pictures, quotes and trivia from thousands of moviesTags: pile FeedWordPressFeedWordPress is an Atom/RSS aggregator for WordPress. It syndicates content from newsfeeds that you select into your WordPress blog; if you syndicate several newsfeeds then you can WordPress’s posts database and templating engine as the back-end of an aggregation (“planet”) website.Tags: blog, rss, […]
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 June 7th
- 2022
- Where’s the Fediverse Shattering Kaboom? I have been lazy in not getting into the IndieWeb game here, but look who is catching up! I activate the Activity Pub plugin but no idea how it knows who I am in Mastodon- this post gave me the clue that is not listed elsewhere- in my WordPress profile at the bottom is a […] ➡
- 2021
- The Magic/Vagary of Google Search We use it so frequently that perhaps we do not marvel that web search works. Especially the one where the brand name becomes the verb. In that googling something, typing a few words into a box, pressing a button, and getting a long stream of positive results. And of course “works” is the laden term […] ➡
- 2018
- Connectively Full From First @ontarioextend Extended Lunch The first Ontario Extend Extended Lunch conversation was very filling. Thanks @ProfessorDannyS, @NurseKillam, @IrenequStewart, @Joanne_Kehoe for joining in. This was my idea to get to know participants and to listen to what they were interested in doing as part of my summer role facilitating the project for Terry Greene, who is again a dad (congrats!). […] ➡
- 2012
- I Can’t GIF it Out of My System This has to stop, but not tonight. I missed the fun of the afternoon shit talking and gif smacking today. With some positive feedback on the last batch, I set out again to see what I could do with GIMP as a tool. For these next two I went for very original material, stuff you […] ➡
- GIFfing with Jules Ok, Jim asked me to up the game, so I am going to get more particular about frame selection for my animated GIFs. We are working on the ds106 kickstarter awards for people who requested an animated GIF in their honor. I’ve got the task to do the one for Boone Gorges, who requested something […] ➡
- GIF Pileup I’m so missing having a copy of Photoshop to work on; my limits now for doing animated GIFs are assembling images– Saving frames from MPEG Stream clip or a series of images form my DSLR, loading as layers into GIMP, and trying to make them flip as needed, I really miss how PhotoShop can try […] ➡
- Evaluating the ds106 Evaluations cc licensed ( BY ) flickr photo shared by cogdogblog Most places I travel people ask me what it’s like working with Jim Groom and while it’s easy to reach for a wise crack (which I usually do), I have to frame this with a lot of awe for the spirit he brings to this […] ➡
- 2011
- Me.Fool()=1 cc licensed ( BY NC SD ) flickr photo shared by Gary Denness I did something dumb on the internet. I should have known better. I should not have clicked. I should not have filled out the form. But, I did. The thing is, when you are cruising through the z-space, your 99.99% vigilance is […] ➡
- 2008
- Spray Your Updates Everwhere with Ping.fm With my recent twitter screen shots I am showing my snark for sure. Yet, I am in no way advocating a rally for “let’s bail on twitter”. And to be honest, it really does not produce urine in my wheaties (as a variant of peeing in Cheerios for @fncil) when twitter goes down, out, or […] ➡
- No Twitter? What to Do When You Can’t Get Your Twitter Fix by cogdogblog posted 7 Jun ’08, 6.07am MDT PST on flickr Newest thing to do whentwitterisdown.com Each click gives you a new idea… Like "Read a MF-ing book" Might be more fun that whentwitterisup.com thanks @mathplourde Share this barking on social media ➡
- 2005
- Stopped Jots I was experimenting with the Jots.com bookmark and publish to weblog API, but as duly noted in comments by Will and James, it was turning my blog reading into more of a linkatorium: I’d rather get it by subbing your Jots feed rather than your blog feed. True, so I am shutting of the publishing […] ➡
- Today’s Jots Movie mistakesgoofs, bloopers, pictures, quotes and trivia from thousands of moviesTags: pile FeedWordPressFeedWordPress is an Atom/RSS aggregator for WordPress. It syndicates content from newsfeeds that you select into your WordPress blog; if you syndicate several newsfeeds then you can WordPress’s posts database and templating engine as the back-end of an aggregation (“planet”) website.Tags: blog, rss, […] ➡
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.