“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 July 10th
- 2014
- 13 Years MC Fudge creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog She was perhaps the dog I’ve lived with who had the best disposition. My ex got a dog for her kids before I moved in; Fusge came from the pound, a chocolate lab / doberman mix. I think the kids tacked on the “MC” […]
- 2013
- ds106 Daily Create Challenge (10): Tracking the Rare, Never Been Filmed, Felinus Poptartus This week on Stranger Than Nature, your host, Nigel K. Levine, is deep in the jungle of Hokkaido, to film the flying mythical creature rumored to live here, Felinus Poptartus… Yes, today’s Daily Create challenge was another video one, two in a row, will the weak survive? For today the task was: Redub the audio […]
- While the MOOC Bus Heads Off, A Modest Proposal for ds106 cc licensed ( BY SA ) flickr photo shared by Alan Levine Universities better get on the MOOC bus, because it is leaving the station… https://twitter.com/audreywatters/status/355031898264846336 "marketing was the main reason his institution was trying a MOOC" http://t.co/5C2ceqgeOA Jump on the bus now cause its going off a cliff — Alan Levine (@cogdog) July 10, […]
- What Google Taketh Away the Zombie Reader Preserveth cc licensed ( BY NC ND ) flickr photo shared by Andrew Barclay Maybe y’all have shrugged and dropped back into Facebook timelines, Google Plus Circles, or Twitter chats. I am not letting go of being Pissed Off at Google for dropping the depth charges on Google Reader. So made I cannot even spell annihilation […]
- 2012
- Are You Up to the Daily Create Seven Day Challenge? I’m bad ass and am kicking sand in your face. We are just about half way through the first year of the ds106 Daily Create, a site we created to inspire people to do small acts of creative challenges every day. It is something I believed in from the start, from even before we launched […]
- Courses As Commodities cc licensed ( BY NC ) flickr photo shared by Jeremy Brooks It’s way too easy to activate the cynical reflex with the wave of MOOC Hysteria – e.g. from the perch of The Atlantic (frankly a red flag goes up over any written thing wrapped in the phrase of “revolutionizing education”) In a recent […]
- Silent Harry He’s the baddest cop on the streets in 1908… I felt I was overdue to sit down and do a ds106 assignment, one to do some iMovie work as a demo for our current students. I was called back to do Return to the Silent Era (one I added myself) with the hopes that I […]
- 2009
- An Aussie Big Fish Story big fish Share this barking on social media
- The Instant Web (Just Add Now) cc licensed flickr photo shared by Slightlynorth My not so accurate radar is being tickled by some recent emerging technologies that some Big Shot may place as the next incremental digit following “Web”. Submitted for your approval, Mr Serling: A lot of talk of “real time search” The whole crazy growth of Twitter, Facebook, etc […]
- 2008
- Melbourne Gigapans Since I am just started playing with taking gigapan images, I was eager to experiment with the device on the trip here in Australia. I dont have fancy case for the thing- I am carting it around in the foam padded cardboard box it got sent to me. I am carrying it in my old […]
- 2006
- Feed2JS New Home (beta) The feed cat is coming out of the bag. A few weeks ago I bought a domain, and with some hosting donated by Aaron at Modevia Web Services, the Feed2JS service that lives now at http://feed2js.org/ has its own home at http://feed2js.org/. All I’ve done is more or less move the current site in whole, […]
- Take My (Old) Job It just goes to show that on the net, someone is always finding things out for you. Doug H was kind enough to let me know that he spotted on the Chronicle an announcement for the Instructional Technologist position at Maricopa I vacated in April. They must have scooped it from the local newspaper ad, […]
- 2005
- In Transition I am coming off of 10 days of rest, travel, and not doing much blogging, reading, or doing anything more significant than lying in a hammock. But I am not back in the office as tomorrow morning I fly to Penn State University for the EDUCAUSE Instructional Technology Leadership Program– this is a pilot of […]
- 2004
- Free PDF Creation Tool (Yawn…) pdfMachine is a $49 PC app for generating PDF files: Our pdf writer pdfMachine converts a print stream from an application directly into a PDF. Once you have installed the pdf writer, open your document that you want to convert, then click “print”, select the “Broadgun pdfMachine printer” and that’s it! A free, Lite version, […]
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 July 10th
- 2014
- 13 Years MC Fudge creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog She was perhaps the dog I’ve lived with who had the best disposition. My ex got a dog for her kids before I moved in; Fusge came from the pound, a chocolate lab / doberman mix. I think the kids tacked on the “MC” […] ➡
- 2013
- ds106 Daily Create Challenge (10): Tracking the Rare, Never Been Filmed, Felinus Poptartus This week on Stranger Than Nature, your host, Nigel K. Levine, is deep in the jungle of Hokkaido, to film the flying mythical creature rumored to live here, Felinus Poptartus… Yes, today’s Daily Create challenge was another video one, two in a row, will the weak survive? For today the task was: Redub the audio […] ➡
- While the MOOC Bus Heads Off, A Modest Proposal for ds106 cc licensed ( BY SA ) flickr photo shared by Alan Levine Universities better get on the MOOC bus, because it is leaving the station… https://twitter.com/audreywatters/status/355031898264846336 "marketing was the main reason his institution was trying a MOOC" http://t.co/5C2ceqgeOA Jump on the bus now cause its going off a cliff — Alan Levine (@cogdog) July 10, […] ➡
- What Google Taketh Away the Zombie Reader Preserveth cc licensed ( BY NC ND ) flickr photo shared by Andrew Barclay Maybe y’all have shrugged and dropped back into Facebook timelines, Google Plus Circles, or Twitter chats. I am not letting go of being Pissed Off at Google for dropping the depth charges on Google Reader. So made I cannot even spell annihilation […] ➡
- 2012
- Are You Up to the Daily Create Seven Day Challenge? I’m bad ass and am kicking sand in your face. We are just about half way through the first year of the ds106 Daily Create, a site we created to inspire people to do small acts of creative challenges every day. It is something I believed in from the start, from even before we launched […] ➡
- Courses As Commodities cc licensed ( BY NC ) flickr photo shared by Jeremy Brooks It’s way too easy to activate the cynical reflex with the wave of MOOC Hysteria – e.g. from the perch of The Atlantic (frankly a red flag goes up over any written thing wrapped in the phrase of “revolutionizing education”) In a recent […] ➡
- Silent Harry He’s the baddest cop on the streets in 1908… I felt I was overdue to sit down and do a ds106 assignment, one to do some iMovie work as a demo for our current students. I was called back to do Return to the Silent Era (one I added myself) with the hopes that I […] ➡
- 2009
- An Aussie Big Fish Story big fish Share this barking on social media ➡
- The Instant Web (Just Add Now) cc licensed flickr photo shared by Slightlynorth My not so accurate radar is being tickled by some recent emerging technologies that some Big Shot may place as the next incremental digit following “Web”. Submitted for your approval, Mr Serling: A lot of talk of “real time search” The whole crazy growth of Twitter, Facebook, etc […] ➡
- 2008
- Melbourne Gigapans Since I am just started playing with taking gigapan images, I was eager to experiment with the device on the trip here in Australia. I dont have fancy case for the thing- I am carting it around in the foam padded cardboard box it got sent to me. I am carrying it in my old […] ➡
- 2006
- Feed2JS New Home (beta) The feed cat is coming out of the bag. A few weeks ago I bought a domain, and with some hosting donated by Aaron at Modevia Web Services, the Feed2JS service that lives now at http://feed2js.org/ has its own home at http://feed2js.org/. All I’ve done is more or less move the current site in whole, […] ➡
- Take My (Old) Job It just goes to show that on the net, someone is always finding things out for you. Doug H was kind enough to let me know that he spotted on the Chronicle an announcement for the Instructional Technologist position at Maricopa I vacated in April. They must have scooped it from the local newspaper ad, […] ➡
- 2005
- In Transition I am coming off of 10 days of rest, travel, and not doing much blogging, reading, or doing anything more significant than lying in a hammock. But I am not back in the office as tomorrow morning I fly to Penn State University for the EDUCAUSE Instructional Technology Leadership Program– this is a pilot of […] ➡
- 2004
- Free PDF Creation Tool (Yawn…) pdfMachine is a $49 PC app for generating PDF files: Our pdf writer pdfMachine converts a print stream from an application directly into a PDF. Once you have installed the pdf writer, open your document that you want to convert, then click “print”, select the “Broadgun pdfMachine printer” and that’s it! A free, Lite version, […] ➡
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.