“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 4th
- 2022
- Right Command Key is My New Spacebar In the ongoing commitment to keep use of my trusty old 2012 Macbook Pro, after a battery replacement last May, the latest challenge was the loss of my spacebar. I did my diligence in watching YouTube videos of various people demonstrating how to pop of the spacebar and clean\inspect. As pried open in the toot […]
- 2019
- Be More Frakes A classy and inspiring example how to be someone of high reputation yet very down to earth in social media… It might be 10 years ago that I was fortunate to take a photography workshop co-lead by famous professional photographer Bill Frakes. Much came of the experience- I got back into using my DSLR after […]
- WordPress Rookie Mistake Never think you are sooooo on top of your code game… Within hours of posting of the features in the updated DS106 Bank theme, including using WordPress accounts for organizing content and sharing the link to a demo site, BAM! SPAM! Not so shiny. So in the theme options allowing WordPress accounts to be used, […]
- 2016
- What’s My Next Online Community Life Cycle Curve? Maybe it’s post US election / brexit hangover information / fake news fatigue. Or the end of the year wind down. Or something else. But I sense changes into the online space I have inhabited the most for the last 9 years. A chunk of the public discussion and banter I enjoy has maybe slipped […]
- 2013
- A Wild Hare Character The schedule of Headless ds106 is wrapping up, the final assignment is posted for week 15… a post somewhere else may be reflecting on the experience and trundling some medium sized data. But given I went a bit AWOL for the mmiddle chunk of the course, I want to close with a bang. I debated […]
- How Boring Can You Get? Two Boring Videos Mashed into One In the messy petri dish of ds106, a simple daily create, spawns, mutates, and morphs into things like It begins with a rather counter intuitive Daily Create for Dec 2, 2013 #ds106 #dailycreate: Make the Most Boring Video on YouTube http://t.co/jHb0RcIezZ — ds106 Daily Create (@ds106dc) December 2, 2013 One I really enjoyed was by […]
- 2012
- Measuring ds106 cc licensed ( BY NC ND ) flickr photo shared by wester I’ve been asked to write a short case study profile of ds106 for a book someone is writing about online teaching and the question came up about how many people have participated in it. I’ve been tinkering at the main site to compile […]
- Cut Off from the Internet cc licensed (BY) flickr photo shared by cogdogblog Since I’ve been home, I’ve not been able to get any AT&T signal on my iPhone- it was moderate signal, 2-3 bars, when I left in January. They said service was weak here. NO SECRET, but also some towers were being reconditioned. It makes little sense; I […]
- To Be Badged, Badge Yourself, and As Good as the Paper it’s… cc licensed ( BY NC ) flickr photo shared by andyp uk While I am intrigued by the technology and promise of open badges, and respect people who are part of the movement, it’s one of those things that Might Be Important But I Don’t Get All That Excited About. Or it’s like forms of […]
- 2007
- After Gamma Comes Love Long time readers know my deep, obsessive love for flickr. Since I recently trolled by del.icio.us past, lets roll my flickr odometer back to March 29, 2004, when I uploaded my first flickr photo. I started exploring flickr at a time I was prepping a TCC conference session on PhotoBlogging. At the time I was […]
- 2006
- What Do You Have to Do To Make Them Take Your Money? I’m not one to look a several thousand dollar windfall gift horse in the eye, but I do believe paying for things I agreed to pay for. But I cannot seem to pay what I owe, not for lack of trying. We had a soft water filtration system installed on our 30 year old Arizona […]
- Unsuggestor Turns Social Software Inside Out This is fun. The huge database of more than 7 million books people have collected in their accounts at LibraryThing (oops, that one is on my list of things yet tried) is mined in a way you might have not thought anyone would want. The “UnSuggestor” takes a book title you enter, and from the […]
- 2003
- Pssss… Have You Heard About RSS? Just posted to the web is our newbie article “Pssss… Have You Heard About RSS?”. This is one of the features in the Fall 2003 issue of our mcli Forum, a twice a year publication published by our office for print distribution inside our college system, and electronic everywhere else (continuously published since October 1992-200 […]
- RSS2JS Update: Date Posted Fix and Future Attractions Yet another small fix to our RSS to Javascript tool— there was a flaw in (my) program logic so that the item posting dates from RSS2.0 feeds were not being converted correctly from their GMT+0 values. If you have a version of this running, you can make a direct edit to both the rss2js.php and […]
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 4th
- 2022
- Right Command Key is My New Spacebar In the ongoing commitment to keep use of my trusty old 2012 Macbook Pro, after a battery replacement last May, the latest challenge was the loss of my spacebar. I did my diligence in watching YouTube videos of various people demonstrating how to pop of the spacebar and clean\inspect. As pried open in the toot […] ➡
- 2019
- Be More Frakes A classy and inspiring example how to be someone of high reputation yet very down to earth in social media… It might be 10 years ago that I was fortunate to take a photography workshop co-lead by famous professional photographer Bill Frakes. Much came of the experience- I got back into using my DSLR after […] ➡
- WordPress Rookie Mistake Never think you are sooooo on top of your code game… Within hours of posting of the features in the updated DS106 Bank theme, including using WordPress accounts for organizing content and sharing the link to a demo site, BAM! SPAM! Not so shiny. So in the theme options allowing WordPress accounts to be used, […] ➡
- 2016
- What’s My Next Online Community Life Cycle Curve? Maybe it’s post US election / brexit hangover information / fake news fatigue. Or the end of the year wind down. Or something else. But I sense changes into the online space I have inhabited the most for the last 9 years. A chunk of the public discussion and banter I enjoy has maybe slipped […] ➡
- 2013
- A Wild Hare Character The schedule of Headless ds106 is wrapping up, the final assignment is posted for week 15… a post somewhere else may be reflecting on the experience and trundling some medium sized data. But given I went a bit AWOL for the mmiddle chunk of the course, I want to close with a bang. I debated […] ➡
- How Boring Can You Get? Two Boring Videos Mashed into One In the messy petri dish of ds106, a simple daily create, spawns, mutates, and morphs into things like It begins with a rather counter intuitive Daily Create for Dec 2, 2013 #ds106 #dailycreate: Make the Most Boring Video on YouTube http://t.co/jHb0RcIezZ — ds106 Daily Create (@ds106dc) December 2, 2013 One I really enjoyed was by […] ➡
- 2012
- Measuring ds106 cc licensed ( BY NC ND ) flickr photo shared by wester I’ve been asked to write a short case study profile of ds106 for a book someone is writing about online teaching and the question came up about how many people have participated in it. I’ve been tinkering at the main site to compile […] ➡
- Cut Off from the Internet cc licensed (BY) flickr photo shared by cogdogblog Since I’ve been home, I’ve not been able to get any AT&T signal on my iPhone- it was moderate signal, 2-3 bars, when I left in January. They said service was weak here. NO SECRET, but also some towers were being reconditioned. It makes little sense; I […] ➡
- To Be Badged, Badge Yourself, and As Good as the Paper it’s… cc licensed ( BY NC ) flickr photo shared by andyp uk While I am intrigued by the technology and promise of open badges, and respect people who are part of the movement, it’s one of those things that Might Be Important But I Don’t Get All That Excited About. Or it’s like forms of […] ➡
- 2007
- After Gamma Comes Love Long time readers know my deep, obsessive love for flickr. Since I recently trolled by del.icio.us past, lets roll my flickr odometer back to March 29, 2004, when I uploaded my first flickr photo. I started exploring flickr at a time I was prepping a TCC conference session on PhotoBlogging. At the time I was […] ➡
- 2006
- What Do You Have to Do To Make Them Take Your Money? I’m not one to look a several thousand dollar windfall gift horse in the eye, but I do believe paying for things I agreed to pay for. But I cannot seem to pay what I owe, not for lack of trying. We had a soft water filtration system installed on our 30 year old Arizona […] ➡
- Unsuggestor Turns Social Software Inside Out This is fun. The huge database of more than 7 million books people have collected in their accounts at LibraryThing (oops, that one is on my list of things yet tried) is mined in a way you might have not thought anyone would want. The “UnSuggestor” takes a book title you enter, and from the […] ➡
- 2003
- Pssss… Have You Heard About RSS? Just posted to the web is our newbie article “Pssss… Have You Heard About RSS?”. This is one of the features in the Fall 2003 issue of our mcli Forum, a twice a year publication published by our office for print distribution inside our college system, and electronic everywhere else (continuously published since October 1992-200 […] ➡
- RSS2JS Update: Date Posted Fix and Future Attractions Yet another small fix to our RSS to Javascript tool— there was a flaw in (my) program logic so that the item posting dates from RSS2.0 feeds were not being converted correctly from their GMT+0 values. If you have a version of this running, you can make a direct edit to both the rss2js.php and […] ➡
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.