“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 20th
- 2016
- The Thing at the Heart of the Convention On Monday night I tuned into opening day festivities of the 2016 Republican via the NPR Radio live broadcast. There’s been much (rightful) talk of plagiarism in the speeches, but the more I listened to the stories boomed over the microphone, the more I had a feeling that I had heard this all before. The […]
- 2013
- ds106 Daily Create Challenge (20): Error Code 410 Grim news Daily Create challenge, a writing one today: Write Your Own Tw-Obituary (your life in less than 140 characters) Another Hat Tip to the Urban Dictionary: “Your life’s work summed up in 140 characters or less. Just the right size for a gravestone perhaps?” Mine is a bit of play on the Twitter API […]
- 2011
- Quarter Turn Tomorrow marks the 4 week mark for this Road Odyssey, which is about 1/4 the time I thought I’d travel (but that is not firm). I’ll cross the 3000 mile point in the morning, somewhere in north Central Washington State. On the map, I won’t make the quarter turn until first week of August, when […]
- 2010
- Cloud Holes cc licensed flickr photo shared by jah~ off n on Last night I had one of those technology #$*&@ moments. I use a portable 500 Gb Firewire drive to keep the master image files for photos I edit in Aperture. It was acting a bit slower than normal, and I began to think it was […]
- 2008
- What a Night in Sydney Dancer by cogdogblog posted 20 Jul ’08, 11.34pm MDT PST on flickr Its CogDog and friends night gathering at Almustafa, a fab Lebanese restaurant in Sydney Leaving Sydney in style… Actually the last night in Sydney was two nights ago… or tomorrow…. or I am #*&ing tired of trying to get time zones sorted out. […]
- 2007
- My Big Left Toe is in Facebook Last time I checked, the toe was into learning objects, but now it is FB bound? Why not. Flickr is in Facebook. Slideshare just entered Facebook. Twitter has been there a while. My dog is in there. The parade goes on and on. I am nodding in agreement with Stephen with some skepticism as to […]
- 2006
- Storymining in Dallas flickr foto Workshop in Dallasavailable on flickr Materials, binders and laptops, for our 3 day workshop for the NMC Marcus project. Storymining is the slick name of the 3-day workshop we (NMC) are doing in Dallas. This is part of our Marcus Project which is helping 24 art museums across the nation of Texas to […]
- 2005
- Looking for ID Our center has a posted opening for an Instructional Designer position working with projects listed on the main MCLI web site. If this sparks any interest, be sure to apply directly to the Maricopa HR department. Any resumes or materials sent to me will be automatically trashed, and I cannot provide any more information than […]
- Round Peg, Not So Round Sweaty Hole flickr foto Round Peg, Not So Round Sweaty Holeavailable on my flickr The iPod ear buds work fine foir sitting on your butt on the couch, in class, on the bus, but for running in our desert heat, I am finding the fit just does not work. Yes, the ear buds are cheap. I am […]
- The Nobel Prize Goes to the Solver of this World Problem flickr foto MessPodavailable on my flickr Every transfer of my iPod to and from my pocket or backpack results in this twisted spaghetti mess of ear bud cable. I guess I should just never remove it from my head? I’d like to have back number of cumulative hours spent untangling the ear bud cables on […]
- Find the Dog Among the boatload of Chinese spam, enlargement/shrinkage offers, gambling teasers, celebrity nude photos that grace my daily email comes a genuine nice message today from Steve Dembo: Hey, I really enjoy reading your blog. Definitely in my top 5. However, every I want to find an article of yours or link back to your site, […]
- What Mean Ye Collaboration Tools? Bear with me on a long introduction here, but later in this post I am asking for ideas and possible remote participation in an upcoming presentation. In an email exchange a few months back, Phil Long had asked me and Stephen Downes (I am the little leg on this stool) thoughts on a presentation on […]
- 2004
- 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 […]
- Not a Big WordPress fan Just stumbled into LiteraryMoose, who minces no words about The Misery of Open-Source Software or Why I don’t Use WordPress This document collects some thoughts on WordPress 1.2, supposedly the greatest invention since sliced ice cubes. What they claim on their front page, is argued point by point, based on my personal experiences and the […]
- Feed2JS Style Tools: Bonsai CSS Zen Garden? I have just twiddled some new tools to help users of Feed2JS to create their customized styles for output created by this service/script. In a total and polite rip off of the css Zen Garden site, I am hoping some designers out there might mess around with the new style tools and submit some new […]
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 20th
- 2016
- The Thing at the Heart of the Convention On Monday night I tuned into opening day festivities of the 2016 Republican via the NPR Radio live broadcast. There’s been much (rightful) talk of plagiarism in the speeches, but the more I listened to the stories boomed over the microphone, the more I had a feeling that I had heard this all before. The […] ➡
- 2013
- ds106 Daily Create Challenge (20): Error Code 410 Grim news Daily Create challenge, a writing one today: Write Your Own Tw-Obituary (your life in less than 140 characters) Another Hat Tip to the Urban Dictionary: “Your life’s work summed up in 140 characters or less. Just the right size for a gravestone perhaps?” Mine is a bit of play on the Twitter API […] ➡
- 2011
- Quarter Turn Tomorrow marks the 4 week mark for this Road Odyssey, which is about 1/4 the time I thought I’d travel (but that is not firm). I’ll cross the 3000 mile point in the morning, somewhere in north Central Washington State. On the map, I won’t make the quarter turn until first week of August, when […] ➡
- 2010
- Cloud Holes cc licensed flickr photo shared by jah~ off n on Last night I had one of those technology #$*&@ moments. I use a portable 500 Gb Firewire drive to keep the master image files for photos I edit in Aperture. It was acting a bit slower than normal, and I began to think it was […] ➡
- 2008
- What a Night in Sydney Dancer by cogdogblog posted 20 Jul ’08, 11.34pm MDT PST on flickr Its CogDog and friends night gathering at Almustafa, a fab Lebanese restaurant in Sydney Leaving Sydney in style… Actually the last night in Sydney was two nights ago… or tomorrow…. or I am #*&ing tired of trying to get time zones sorted out. […] ➡
- 2007
- My Big Left Toe is in Facebook Last time I checked, the toe was into learning objects, but now it is FB bound? Why not. Flickr is in Facebook. Slideshare just entered Facebook. Twitter has been there a while. My dog is in there. The parade goes on and on. I am nodding in agreement with Stephen with some skepticism as to […] ➡
- 2006
- Storymining in Dallas flickr foto Workshop in Dallasavailable on flickr Materials, binders and laptops, for our 3 day workshop for the NMC Marcus project. Storymining is the slick name of the 3-day workshop we (NMC) are doing in Dallas. This is part of our Marcus Project which is helping 24 art museums across the nation of Texas to […] ➡
- 2005
- Looking for ID Our center has a posted opening for an Instructional Designer position working with projects listed on the main MCLI web site. If this sparks any interest, be sure to apply directly to the Maricopa HR department. Any resumes or materials sent to me will be automatically trashed, and I cannot provide any more information than […] ➡
- Round Peg, Not So Round Sweaty Hole flickr foto Round Peg, Not So Round Sweaty Holeavailable on my flickr The iPod ear buds work fine foir sitting on your butt on the couch, in class, on the bus, but for running in our desert heat, I am finding the fit just does not work. Yes, the ear buds are cheap. I am […] ➡
- The Nobel Prize Goes to the Solver of this World Problem flickr foto MessPodavailable on my flickr Every transfer of my iPod to and from my pocket or backpack results in this twisted spaghetti mess of ear bud cable. I guess I should just never remove it from my head? I’d like to have back number of cumulative hours spent untangling the ear bud cables on […] ➡
- Find the Dog Among the boatload of Chinese spam, enlargement/shrinkage offers, gambling teasers, celebrity nude photos that grace my daily email comes a genuine nice message today from Steve Dembo: Hey, I really enjoy reading your blog. Definitely in my top 5. However, every I want to find an article of yours or link back to your site, […] ➡
- What Mean Ye Collaboration Tools? Bear with me on a long introduction here, but later in this post I am asking for ideas and possible remote participation in an upcoming presentation. In an email exchange a few months back, Phil Long had asked me and Stephen Downes (I am the little leg on this stool) thoughts on a presentation on […] ➡
- 2004
- 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 […] ➡
- Not a Big WordPress fan Just stumbled into LiteraryMoose, who minces no words about The Misery of Open-Source Software or Why I don’t Use WordPress This document collects some thoughts on WordPress 1.2, supposedly the greatest invention since sliced ice cubes. What they claim on their front page, is argued point by point, based on my personal experiences and the […] ➡
- Feed2JS Style Tools: Bonsai CSS Zen Garden? I have just twiddled some new tools to help users of Feed2JS to create their customized styles for output created by this service/script. In a total and polite rip off of the css Zen Garden site, I am hoping some designers out there might mess around with the new style tools and submit some new […] ➡
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.