“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 14 posts previously published on December 22nd
- 2021
- Banging the Pipes of the Web Site til it Works (or not) I’m grudgingly accepting that for most people the work of maintaining their own domain and web sites is too much. They’ve substacked to email newsletters, medium-ed over to hosted writing places, knuckled in to LinkedIn, or hoist their thoughts as tweeted threads. It’s not game over, and plenty of folks are still ending their own […]
- 2016
- Guest Post: Can I Auto Tweet Alan’s Photos of Me? Hi there CogDogBlog readers. Alan went outside and has been gone a while, but he left his laptop open. I see him blogging here all the time and thought I would give it a try. Yes, I am Felix. Maybe you have seen one of my 600 photos Alan has posted on flickr this year? […]
- 2014
- Skittering Along The Great Curiosity Engine — to Baker Bill File this one as another Alan Falls Down A Slender Thread of Web Connections and Wants To Scream “ISN’T THIS AMAZING?” In all the ways the web has become, for those under 25, something that has always been there, and hence not a technology’ it’s not viral big trending stuff or the oft tweeted videos […]
- 2012
- Fort GIFpache Here comes my epic multi GIF bonanza as part of the ds106 GIFfest, it might fall into a Multi-GIF story. It’s BROUGHT TO EXCITING LIFE! What follows are 16 GIFfable scenes from the 1948 John Ford Western, Fort Apache. Rented from the nifty little library in Pine, AZ, the movie appeals on several levels, first […]
- 2011
- iPhone Freed My new unlocked 4s is in action here in Canada. I went to a Virgin Mobile kiosk in a mall here in Welland and got a pay as you go plan set up, the sim card installed, and unlike my experience with Yes Optus in Australia, it worked right away. So now in Canada, I […]
- Captcha Art (ds106 assignment) Among other TEDx Talk videos I have seen recently, the one by Luis von Ahn on Massive-scale online collaboration, Stephen Downes notwithstanding, generated a number of ideas for me. von Ahn is the man behind the idea of reCaptcha– originally a Carnegie-Mellon project eventurally gobbled up by Google. What I liked most is his example […]
- When Creative Commons Gets Fishy cc licensed ( BY NC ND ) flickr photo shared by only alice Creative commons usage can be vague and tricky on its own, but it gets even more fishy. I was searching compfight for an image to use with a puff rant on predictions. This flickr image, licensed CC BY, that came up on […]
- Predicting Predictions cc licensed ( BY NC SD ) flickr photo shared by adamthelibrarian It’s been a few years since my last round of predictions (for 2009), but I’m counting on being 100% accurate. My prediction for 2012 is a ton of predictions for 2012. That’s all I got. For a refreshing approach to this old shlock, […]
- 2009
- Flattery By Spam Will Get You… I regret I don’t know Russian since I cannot read about 60% of my blog comments, but among the rest, I get so many nice things that people say! It really warms my heart that people can be so kind, they even say things that are not relevant to my blog posts. Your website came […]
- 2006
- Turn The Blog Off And … It’s end of the year time to unplug, and transmit one more blog post (at least until Tuesday!). So take this one as a loud CogDogBlog Howling At the Moon wish for everyone to have some peace, reflection, and fun for whatever holidays you celebrate. I’m unplugging here at 6000 feet elevation in central Arizona, […]
- 2004
- Heavy Web Pages and Content Density I have barked some about “information density” something lifted from the Tomes of Tufte — in my web travels I come across some sites that just have way too much in the gutters, banners, et al, and not much meet. Since Clara Peller is not around much, I have to ask, “Where’s the Beef?” So […]
- How to Stop HTML Thieves A frequent question we get from our Writing HTML tutorial is: “what code can I use to prevent people from viewing/stealing the source code of my web pages?” and the answer is very similar to what i say to people when they want to protect their images on web pages from being stolen- if you […]
- I Google Scholar-ed Myself I’ll leave the academic wrestling over Google Scholar to the academics– I was more humanly curious what I could find there… so did a self Google to see if I could find a reference to my previous life. Before materializing as an instructional technologist at Maricopa, I was a graduate student in, of all things […]
- 2003
- RSS WinterFest 2004- Party at Dave’s? Just announced, Jan 21-22, 2004, RSS Winterfest: a free Webcast, and hear from some of the world’s foremost experts and commentators about RSS and the future of Internet content syndication. We’ll give an overview of RSS and look at its future. We’ll feature case studies that will examine the applications for enterprise content syndication. We’ll hear what some of […]
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 December 22nd
- 2021
- Banging the Pipes of the Web Site til it Works (or not) I’m grudgingly accepting that for most people the work of maintaining their own domain and web sites is too much. They’ve substacked to email newsletters, medium-ed over to hosted writing places, knuckled in to LinkedIn, or hoist their thoughts as tweeted threads. It’s not game over, and plenty of folks are still ending their own […] ➡
- 2016
- Guest Post: Can I Auto Tweet Alan’s Photos of Me? Hi there CogDogBlog readers. Alan went outside and has been gone a while, but he left his laptop open. I see him blogging here all the time and thought I would give it a try. Yes, I am Felix. Maybe you have seen one of my 600 photos Alan has posted on flickr this year? […] ➡
- 2014
- Skittering Along The Great Curiosity Engine — to Baker Bill File this one as another Alan Falls Down A Slender Thread of Web Connections and Wants To Scream “ISN’T THIS AMAZING?” In all the ways the web has become, for those under 25, something that has always been there, and hence not a technology’ it’s not viral big trending stuff or the oft tweeted videos […] ➡
- 2012
- Fort GIFpache Here comes my epic multi GIF bonanza as part of the ds106 GIFfest, it might fall into a Multi-GIF story. It’s BROUGHT TO EXCITING LIFE! What follows are 16 GIFfable scenes from the 1948 John Ford Western, Fort Apache. Rented from the nifty little library in Pine, AZ, the movie appeals on several levels, first […] ➡
- 2011
- iPhone Freed My new unlocked 4s is in action here in Canada. I went to a Virgin Mobile kiosk in a mall here in Welland and got a pay as you go plan set up, the sim card installed, and unlike my experience with Yes Optus in Australia, it worked right away. So now in Canada, I […] ➡
- Captcha Art (ds106 assignment) Among other TEDx Talk videos I have seen recently, the one by Luis von Ahn on Massive-scale online collaboration, Stephen Downes notwithstanding, generated a number of ideas for me. von Ahn is the man behind the idea of reCaptcha– originally a Carnegie-Mellon project eventurally gobbled up by Google. What I liked most is his example […] ➡
- When Creative Commons Gets Fishy cc licensed ( BY NC ND ) flickr photo shared by only alice Creative commons usage can be vague and tricky on its own, but it gets even more fishy. I was searching compfight for an image to use with a puff rant on predictions. This flickr image, licensed CC BY, that came up on […] ➡
- Predicting Predictions cc licensed ( BY NC SD ) flickr photo shared by adamthelibrarian It’s been a few years since my last round of predictions (for 2009), but I’m counting on being 100% accurate. My prediction for 2012 is a ton of predictions for 2012. That’s all I got. For a refreshing approach to this old shlock, […] ➡
- 2009
- Flattery By Spam Will Get You… I regret I don’t know Russian since I cannot read about 60% of my blog comments, but among the rest, I get so many nice things that people say! It really warms my heart that people can be so kind, they even say things that are not relevant to my blog posts. Your website came […] ➡
- 2006
- Turn The Blog Off And … It’s end of the year time to unplug, and transmit one more blog post (at least until Tuesday!). So take this one as a loud CogDogBlog Howling At the Moon wish for everyone to have some peace, reflection, and fun for whatever holidays you celebrate. I’m unplugging here at 6000 feet elevation in central Arizona, […] ➡
- 2004
- Heavy Web Pages and Content Density I have barked some about “information density” something lifted from the Tomes of Tufte — in my web travels I come across some sites that just have way too much in the gutters, banners, et al, and not much meet. Since Clara Peller is not around much, I have to ask, “Where’s the Beef?” So […] ➡
- How to Stop HTML Thieves A frequent question we get from our Writing HTML tutorial is: “what code can I use to prevent people from viewing/stealing the source code of my web pages?” and the answer is very similar to what i say to people when they want to protect their images on web pages from being stolen- if you […] ➡
- I Google Scholar-ed Myself I’ll leave the academic wrestling over Google Scholar to the academics– I was more humanly curious what I could find there… so did a self Google to see if I could find a reference to my previous life. Before materializing as an instructional technologist at Maricopa, I was a graduate student in, of all things […] ➡
- 2003
- RSS WinterFest 2004- Party at Dave’s? Just announced, Jan 21-22, 2004, RSS Winterfest: a free Webcast, and hear from some of the world’s foremost experts and commentators about RSS and the future of Internet content syndication. We’ll give an overview of RSS and look at its future. We’ll feature case studies that will examine the applications for enterprise content syndication. We’ll hear what some of […] ➡
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.