“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 February 11th
- 2025
- Chasing Down the Ghost Internet Tracks of Scottlo’s SRBs Apparently writers with orders of magnitude more readers than I are penning saga length whinging rage posts about how terrible technology is. Oh they keep moving the buttons on me! Teams Sucks. Google Search is junk. Technology is terrible. I don’t counter the disgust of bad software interfaces (oh reminds me I have a post […]
- 2016
- Overworked in San Juan? OMG, the working conditions I have this month (/me ducks)… no that is my afternoon on Sunday at the beach I can walk to from the Sagrado campus (Sunday morning was spent working on web sites, ok?) Seriously, it is full on weekdays and evening prep in the first 1 days here. So far I […]
- Seeking Web Tricks Better Than “Chicken on a Skateboard” I have been asked to do a faculty workshop a week from Friday, where they more or less asked for “cool web stuff” (not quite what I did for students last week). The working title (because I Do Not Start Work Until I Have a Title) is “Silly / Useful Web Tricks”. This name is […]
- 2015
- Inside the RSS Magic Box Wow, I thought I had written this up somewhere, but because Ken asked, and he is doing cool stuff with his Connected Course… Can anyone share the code for the Magic Box #CCourses http://t.co/lv3QFzS45M @cogdog @mburtis @timmmmyboy ? — Ken Bauer Favel (@ken_bauer) February 11, 2015 What is the Magic Box? Not much magic, but […]
- 2013
- Thirds in Your Photographs This week in ds106, my class starts a week of looking at visual storytelling, primarily in working with their own photographs. For me, this is some of my favorite stuff since I love taking photos. I’d like them all to get better at taking interesting photos, moving from snapshot mentality to be composing in their […]
- 2012
- Pre/Post Apocalyptic Moods I have been wanting to make a good attempt at Annie Belle’s Switch up the Mood ds106 assignment: Color, lighting, saturation, contrast, and many other factors all play in to taking a decent photo and making it fabulous. This assignment is to change the mood or tone of a photograph by altering the contrast, brightness, […]
- 2008
- Bark is Back It’s been about a week since I launched this year’s week of no blogging / only commenting. This is hardly an exact, precise activity, and I am honored by the wide range of incoming links (the non spam variety, of course). So according to coComment, I posted 57 comments this week, admittedly a lot were […]
- 2006
- Northern Voice Opening pieces of Northern Voice 2006. I would have thought the auditorium would be a wee bit more packed. First up was Starting with Fire: Why Stories Are Essential and How to Blog Effective Tales by Julie Leung. There was something very refreshing in the presentation style (pure images, a pointed presentation lacking word bullet […]
- Nancy “Snow” White: Seven Competencies of Online Interaction Day One of the Northern Voice conference, and Nancy White is running a great session on the important assets of online interaction. I hastily set up my iRiver to get a recording, may be noisy due to proximity to projector fan. And I rushed the editing. http://cogdogblog.com/wp-content/audio/nancy_white_nv06.mp3 [52 minute MP3, 24 Mb] Some sloppy written […]
- 2005
- Flipping the Question:”Why DON’T Academics Blog?” Liz Lawly recently shared a great collection of edublogger’s explanations for why they blog: I keep getting asked this question by colleagues here at RIT and elsewhere, and I find myself sending them the same links over and over again. So here’s what I give people who ask me this, in an attempt to clarify […]
- Feedback Gems: Small Pieces In Spain Among the chaff of email spam are a few gems. Here is one from Ian in Spain who has figured out how to leverage RSS, blogs, and Feed2JS to generate a dynamic site: Hi Your rss2js service is first class. I love the code generator and the service itself – what a great job! I […]
- Visualize Your flickr FOAF Woah, nellie! I had no idea when I clicked a link that said, “do not, I REPEAT, do not go here” (the old teacher reports read “Alan does not listen well to instructions”) that I’d find this wildly fantastic flickr graph tool: Flickr Graph is an application that explores the social relationships inside flickr.com. It […]
- 2004
- Old Fashioned Junk Mail I hardly blink while deleting all of the unsolicited crap that hits the e-mail inbox. But just as a throwback, I got a flier in my postal mail at work for “everything you need to know in an intensive 2-day seminar!”: Centrifugal Pumps: Troubleshoot and Maintain Centrifugal Pumps- Learn How to Reduce the Amount of […]
- Beware of Blogs in Plaid Jackets While opportunistic greed vultures are circling over RSS, the used blog sales men have set up their hawkster wares down on the corner. Witness BlogToRiche$.com: Imagine earning an additional income, or more, by doing what you are already doing…BLOGGING! That’s right, I’ve outlined the basic techniques of how to use your Blog to make money! […]
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 February 11th
- 2025
- Chasing Down the Ghost Internet Tracks of Scottlo’s SRBs Apparently writers with orders of magnitude more readers than I are penning saga length whinging rage posts about how terrible technology is. Oh they keep moving the buttons on me! Teams Sucks. Google Search is junk. Technology is terrible. I don’t counter the disgust of bad software interfaces (oh reminds me I have a post […] ➡
- 2016
- Overworked in San Juan? OMG, the working conditions I have this month (/me ducks)… no that is my afternoon on Sunday at the beach I can walk to from the Sagrado campus (Sunday morning was spent working on web sites, ok?) Seriously, it is full on weekdays and evening prep in the first 1 days here. So far I […] ➡
- Seeking Web Tricks Better Than “Chicken on a Skateboard” I have been asked to do a faculty workshop a week from Friday, where they more or less asked for “cool web stuff” (not quite what I did for students last week). The working title (because I Do Not Start Work Until I Have a Title) is “Silly / Useful Web Tricks”. This name is […] ➡
- 2015
- Inside the RSS Magic Box Wow, I thought I had written this up somewhere, but because Ken asked, and he is doing cool stuff with his Connected Course… Can anyone share the code for the Magic Box #CCourses http://t.co/lv3QFzS45M @cogdog @mburtis @timmmmyboy ? — Ken Bauer Favel (@ken_bauer) February 11, 2015 What is the Magic Box? Not much magic, but […] ➡
- 2013
- Thirds in Your Photographs This week in ds106, my class starts a week of looking at visual storytelling, primarily in working with their own photographs. For me, this is some of my favorite stuff since I love taking photos. I’d like them all to get better at taking interesting photos, moving from snapshot mentality to be composing in their […] ➡
- 2012
- Pre/Post Apocalyptic Moods I have been wanting to make a good attempt at Annie Belle’s Switch up the Mood ds106 assignment: Color, lighting, saturation, contrast, and many other factors all play in to taking a decent photo and making it fabulous. This assignment is to change the mood or tone of a photograph by altering the contrast, brightness, […] ➡
- 2008
- Bark is Back It’s been about a week since I launched this year’s week of no blogging / only commenting. This is hardly an exact, precise activity, and I am honored by the wide range of incoming links (the non spam variety, of course). So according to coComment, I posted 57 comments this week, admittedly a lot were […] ➡
- 2006
- Northern Voice Opening pieces of Northern Voice 2006. I would have thought the auditorium would be a wee bit more packed. First up was Starting with Fire: Why Stories Are Essential and How to Blog Effective Tales by Julie Leung. There was something very refreshing in the presentation style (pure images, a pointed presentation lacking word bullet […] ➡
- Nancy “Snow” White: Seven Competencies of Online Interaction Day One of the Northern Voice conference, and Nancy White is running a great session on the important assets of online interaction. I hastily set up my iRiver to get a recording, may be noisy due to proximity to projector fan. And I rushed the editing. http://cogdogblog.com/wp-content/audio/nancy_white_nv06.mp3 [52 minute MP3, 24 Mb] Some sloppy written […] ➡
- 2005
- Flipping the Question:”Why DON’T Academics Blog?” Liz Lawly recently shared a great collection of edublogger’s explanations for why they blog: I keep getting asked this question by colleagues here at RIT and elsewhere, and I find myself sending them the same links over and over again. So here’s what I give people who ask me this, in an attempt to clarify […] ➡
- Feedback Gems: Small Pieces In Spain Among the chaff of email spam are a few gems. Here is one from Ian in Spain who has figured out how to leverage RSS, blogs, and Feed2JS to generate a dynamic site: Hi Your rss2js service is first class. I love the code generator and the service itself – what a great job! I […] ➡
- Visualize Your flickr FOAF Woah, nellie! I had no idea when I clicked a link that said, “do not, I REPEAT, do not go here” (the old teacher reports read “Alan does not listen well to instructions”) that I’d find this wildly fantastic flickr graph tool: Flickr Graph is an application that explores the social relationships inside flickr.com. It […] ➡
- 2004
- Old Fashioned Junk Mail I hardly blink while deleting all of the unsolicited crap that hits the e-mail inbox. But just as a throwback, I got a flier in my postal mail at work for “everything you need to know in an intensive 2-day seminar!”: Centrifugal Pumps: Troubleshoot and Maintain Centrifugal Pumps- Learn How to Reduce the Amount of […] ➡
- Beware of Blogs in Plaid Jackets While opportunistic greed vultures are circling over RSS, the used blog sales men have set up their hawkster wares down on the corner. Witness BlogToRiche$.com: Imagine earning an additional income, or more, by doing what you are already doing…BLOGGING! That’s right, I’ve outlined the basic techniques of how to use your Blog to make money! […] ➡
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.