“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 15 posts previously published on July 4th
- 2016
- Twas Never Forevernote You could smell the self-righteous fuming over the intertubez when Evernote announced changes in their free plans. Here is a little lesson in human nature. No one likes having something taken away from them by someone else. It’s easy to predict the reactions: Outright anger from people who used a product for years without paying […]
- Thin Book, Bond, Thin How much surprise comes out of a thin little book! I’ve had this hardback copy of Ian Fleming’s Casino Royale on my shelf for a number of years. To be honest, it was from a batch of old books I purchased mainly for having a variety of old books to fill a book case. Published […]
- 2015
- The 60000 Times Faster Quest May Be in the FedWiki Cards According to my Kindle Reader I am only 18% into Alex Wright’s Cataloging The World: Paul Otlet and the Birth of the Information Age. But I am all in. As a precedent to Vannevar Bush, Belgian information organizer Otlet is credited with envisioning many of the technologies and ideas behind this internet thing I am […]
- 2014
- James Dog: You Only Bark Twice Dusting off some ds106 poster riffing. I guess there as some fun banter about remixing james bond posters with some dogs we know, Mariana was off and running with it… But she let me down by not making it an assignment. So I had to step in with The Best Bond Is A Dog: All […]
- Reading Bandits I cannot claim as ambitious a summer reading agenda as Jim Groom, but somehow I have managed to finish an unprecedented two novels in the last 3 weeks. Both were titles I picked up at one of the book sales from the Pine Arizona Library; first was David Mitchell’s Black Swan Green; I grabbed that […]
- Free #thoughtvectors Inquiry Project Idea Available In scanning the Thoughtvectors blogs and twitter stream, a lot of students/participants are well on their way starting their Inquiry Projects. But should anyone be in search of one, I have one I started a while ago, that is free for anyone to run with. It is almost a year since last reporting on the […]
- 2013
- ds106 Daily Create (4) I Hammock, Therefore I Multitask I am running string for the ds106 Daily Create Summer Challenge- I’m gonna do every day! Today’s was a video challenge: Multitask! Make a video of you doing three or more tasks at the same time. As a note, our Daily Create site has not been able to reliably aggregate videos by Tag because apparently […]
- ds106 Daily Create Challenge (3): Your Dog Leaders Just under the gun for doing yesterday’s ds106 daily create: Combine Three Great Past Leaders into One- Who is it and what are their combined characteristics? cc licensed ( BY NC SA ) flickr photo shared by LEOL30 + cc licensed ( BY NC SA ) flickr photo shared by Elizabeth Thomsen + cc licensed […]
- 2012
- home cc licensed ( BY ) flickr photo shared by cogdogblog So many swirls of emotions on getting back to my little place in Strawberry AZ, arriving Monday night. It’s like… I just left, it’s that sense of belonging and being in sync with myself. The dry cool air, the smell of pines, the quiet of […]
- 2010
- Sign of the Blog Times Dear Blog, I’ve been gone so long you are not familiar with who I am? Who, but myself, can I hold up for blame? Have you forsaken me for another, given my inattention? Stephen has already dropped the Wiley E Coyote anvil sized hint. Yet, as we have talked before, fewer things are lamer than […]
- 2008
- Look Out! CDB is Australia Bound On July 5, while most of America is recovering form whatever it is they do to themselves the day before, I’ll be strapped into a plane 15 hours to fly to Australia. Yes, despite whatever happened, whomever I coughed on, on my visit there last October they are letting me come back. modified from creative […]
- Swurl… Small Pieces Nicely? Lovely? Easily? Joined I’m not sure what to call the breed of web tools that enable you to draw in content from other web X.0 sites automatically– some call them lifestream (maybe not, wikipedia lands you somewhere else) more like http://lifestreamblog.com/. Swurl is a new one and I am liking its elegance. I get my requisite custom URL […]
- 2006
- One Scary Blog Header Photo Judge for yourself…. http://aralbalkan.com/ :-0 thought there is cool stuff here like FlashAid Share this barking on social media
- Sprinkle Some Ajax into Feed2JS? While mulling over how to move Feed2JS to a more stable, friendly, supported home, especially sparked by the comments by David, I am thinking a whole new framework is in order. Don;t worry, I will leave the legacy… er, curent code as is. My own prime directive is not to break anyone’s previously constructed pasted […]
- Not So Virtual Liftoff flickr foto Rocket’s Readyavailable on flickr Today was NASA’s third time this week hoping on good weather for the liftoff of the Space Shuttle. How cool it went smoothly on July 4! I was among 70 avatars watching the coverage live from the International Space Flight Museum in Second Life (they capped the attendance at […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 15 posts previously published on July 4th
- 2016
- Twas Never Forevernote You could smell the self-righteous fuming over the intertubez when Evernote announced changes in their free plans. Here is a little lesson in human nature. No one likes having something taken away from them by someone else. It’s easy to predict the reactions: Outright anger from people who used a product for years without paying […] ➡
- Thin Book, Bond, Thin How much surprise comes out of a thin little book! I’ve had this hardback copy of Ian Fleming’s Casino Royale on my shelf for a number of years. To be honest, it was from a batch of old books I purchased mainly for having a variety of old books to fill a book case. Published […] ➡
- 2015
- The 60000 Times Faster Quest May Be in the FedWiki Cards According to my Kindle Reader I am only 18% into Alex Wright’s Cataloging The World: Paul Otlet and the Birth of the Information Age. But I am all in. As a precedent to Vannevar Bush, Belgian information organizer Otlet is credited with envisioning many of the technologies and ideas behind this internet thing I am […] ➡
- 2014
- James Dog: You Only Bark Twice Dusting off some ds106 poster riffing. I guess there as some fun banter about remixing james bond posters with some dogs we know, Mariana was off and running with it… But she let me down by not making it an assignment. So I had to step in with The Best Bond Is A Dog: All […] ➡
- Reading Bandits I cannot claim as ambitious a summer reading agenda as Jim Groom, but somehow I have managed to finish an unprecedented two novels in the last 3 weeks. Both were titles I picked up at one of the book sales from the Pine Arizona Library; first was David Mitchell’s Black Swan Green; I grabbed that […] ➡
- Free #thoughtvectors Inquiry Project Idea Available In scanning the Thoughtvectors blogs and twitter stream, a lot of students/participants are well on their way starting their Inquiry Projects. But should anyone be in search of one, I have one I started a while ago, that is free for anyone to run with. It is almost a year since last reporting on the […] ➡
- 2013
- ds106 Daily Create (4) I Hammock, Therefore I Multitask I am running string for the ds106 Daily Create Summer Challenge- I’m gonna do every day! Today’s was a video challenge: Multitask! Make a video of you doing three or more tasks at the same time. As a note, our Daily Create site has not been able to reliably aggregate videos by Tag because apparently […] ➡
- ds106 Daily Create Challenge (3): Your Dog Leaders Just under the gun for doing yesterday’s ds106 daily create: Combine Three Great Past Leaders into One- Who is it and what are their combined characteristics? cc licensed ( BY NC SA ) flickr photo shared by LEOL30 + cc licensed ( BY NC SA ) flickr photo shared by Elizabeth Thomsen + cc licensed […] ➡
- 2012
- home cc licensed ( BY ) flickr photo shared by cogdogblog So many swirls of emotions on getting back to my little place in Strawberry AZ, arriving Monday night. It’s like… I just left, it’s that sense of belonging and being in sync with myself. The dry cool air, the smell of pines, the quiet of […] ➡
- 2010
- Sign of the Blog Times Dear Blog, I’ve been gone so long you are not familiar with who I am? Who, but myself, can I hold up for blame? Have you forsaken me for another, given my inattention? Stephen has already dropped the Wiley E Coyote anvil sized hint. Yet, as we have talked before, fewer things are lamer than […] ➡
- 2008
- Look Out! CDB is Australia Bound On July 5, while most of America is recovering form whatever it is they do to themselves the day before, I’ll be strapped into a plane 15 hours to fly to Australia. Yes, despite whatever happened, whomever I coughed on, on my visit there last October they are letting me come back. modified from creative […] ➡
- Swurl… Small Pieces Nicely? Lovely? Easily? Joined I’m not sure what to call the breed of web tools that enable you to draw in content from other web X.0 sites automatically– some call them lifestream (maybe not, wikipedia lands you somewhere else) more like http://lifestreamblog.com/. Swurl is a new one and I am liking its elegance. I get my requisite custom URL […] ➡
- 2006
- One Scary Blog Header Photo Judge for yourself…. http://aralbalkan.com/ :-0 thought there is cool stuff here like FlashAid Share this barking on social media ➡
- Sprinkle Some Ajax into Feed2JS? While mulling over how to move Feed2JS to a more stable, friendly, supported home, especially sparked by the comments by David, I am thinking a whole new framework is in order. Don;t worry, I will leave the legacy… er, curent code as is. My own prime directive is not to break anyone’s previously constructed pasted […] ➡
- Not So Virtual Liftoff flickr foto Rocket’s Readyavailable on flickr Today was NASA’s third time this week hoping on good weather for the liftoff of the Space Shuttle. How cool it went smoothly on July 4! I was among 70 avatars watching the coverage live from the International Space Flight Museum in Second Life (they capped the attendance at […] ➡
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.