“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 19 posts previously published on August 4th
- 2024
- Building Yer Own Tools I recently managed to fix an issue with a water pump I use for our irrigation projects that someone else had put together for me. The fix was round about. I did some web searching, found the culprit was likely a pressure switch, ended up swapping the whole pump out, rewiring it the same, and […]
- 2022
- Getting Beyond the AI Exuberance of Promptism I have to admit doing some bit of tossing phrases into one of the DALL-E Mini generators to gawk/shrug/tweet about what emerged. There is a bit of natural curiosity to either get a result that is a stunning graphic but what seems more common in my attempts… crap. So I like seeing my colleague Bryan […]
- 2016
- The Water Knife Really Drove a Cadillac It did not take long to finish the last 44.2% of Paolo Bacigalupi’s The Water Knife I blogged abut two days ago. It definitely picked up in excitement like the rush of a flood over the rocks of a desert arroyo. I’m not going to talk much about the second half, no spoilers, but have […]
- 2015
- Where is That Photo? Wow it has been a long time since I saw a Brunton Pocket Transit, probably back to grad school Geology. It may not have much relevance to the post, but I warm to the nostalgia. Maybe it does, because it was my study of Geology that got me thinking about something I saw online today. […]
- 2012
- Crawling Through A Small Aperture: Forced Riding Mountain Lion cc licensed ( BY NC SD ) flickr photo shared by Cyberslayer Where is the cheese? I really do not give a rats fart about operating systems. I’d rather know they were not even there, just like I do not dwell too much on the combustion of fuel inside my truck engine or how well […]
- 2010
- Five Card Flickr Stories Bonus: See All Stories with One Photo I have a few upcoming presentations where I plan to use Five Card Flickr Stories so was compelled to try and toss a few more code tweaks onto the bin. The newest is an ability, when a story is published, to see for one one photo, all the other stories that it appears in. So […]
- The “e” in ePub Does Not Stand for Easy cc licensed flickr photo shared by michael.heiss Given the rising tide/trend of electronic books, for a number of months I’ve been pondering how to make our NMC publications available in an ebook format. With the push of an iThing it looked like ePub was the format to aim for. It is after all, a standard […]
- 2009
- Clippy Tweets! cc licensed flickr photo shared by cogdogblog You can tweet but you cannot hide. If you mention "Clippy" in a tweet, that *#&$ing paper clip will hear you and reply, in that "I’m trying to be helpful but am annoying as biting ants in your shorts" way. Try it. Tweet something snarky about Clippy. Insult […]
- 2008
- Wikis and Pushups, like Anchovies and Oatmeal? There’s just somethings you don’t think of going together, but the web never fails to unveil, almost on a daily basis, an example of some use you would not have imagined the day before. So when Coop was visiting this weekend, she told me about a local group of Arizona folks participating in the 100 […]
- Help Pack my (presentation) Bag For WordCamp As noted with much excitement last week, I am going to WordCamp August 16. It all got notched up a bit now when I got an email from Matt (yes that ma.tt – what a URL! I looked into getting al.an but the Dutch refused to go for such a short domain). Anyhow (with a […]
- iFlickr Lots of new iPhone/iPod apps for accessing Flickr. Using now Exposure from connected flow (same folks that make iPhoto/aperature export plugin). Blogging from iPod for the fun of it! Share this barking on social media
- 2006
- My Own URL After some intense days this week (three > 2 AM nights, more on that later), it was nice to kick back and just sift through some neglected RSS injected content in my aggregator. So I was reading Gardner Campbell describe In My Life, where he shares the moments of his transition from University of Mary […]
- Earlier Patent The patent eager folks at Bb seemed to have missed a crucial earlier patent which usurps everything they claim: Socrates Awarded Patent on Learning Methodology ATHENS–(BUSINESS LIAR)–July 26, 440 BC–Socrates Inc. (NASDAQ:SOCRA), a leading provider of philosophical ideas and services to the education industry, announced that it has been issued a U.S. patent for the […]
- 2005
- 2004
- Feed2JS Build and Style Tools Back to code. I modified the download-able version of our Feed2JS to provide local installations the same build and CSS select/modify tools we offer on the main site. The primary reason is getting it set up on a server in New Zealand for my pending visits there for workshops in November. This was a fairly […]
- Kick the Dog About the Blog I asked for it. I got it. Some good, healthy, swift kicks regarding yesterdays 2 part frothy rants on This Ain’t No Blogging (parts 1 and 2), both via comments and trackbacks. Thanks Scott, Dan. Stephen, James, David, Rino (I think, I cannot read Norwegian), Brian, Tom and everyone else who decides to pile on. […]
- 2003
- Amazon RSS Feed-Builder Although Boris recently blogged on a convoluted way to get RSS feeds from Amazon.com, there is a slicker interface from onfocus , the Amazon RSS Feed Builder. This site is by “pb” or Paul Bausch, “co-developer” of Blogger and author of Amazon Hacks, so definitely no slouch at the programming command line. It is the […]
- MT Weblog as Courseware Simply wonderful. RIT professor Liz Lawley is doing some great things by (a) trying; and (b) sharing here efforts in using movabletype as courseware. A version of her Fall 2003 Introduction to Multimedia courseblog is available for peeking (her own mamamusings blog is worth looking at just to see what good work with CSS can […]
- Games for Learning, What a Concept Both Stephen and George recently pointed to this bit from Wired News: Educators Turn to Games for Help. What an idea! … wait a minute, we took a look at Shall We Teach with a Game? back in 1994 at that time, with having our faculty review a selection of CD-ROM games for potential in […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 19 posts previously published on August 4th
- 2024
- Building Yer Own Tools I recently managed to fix an issue with a water pump I use for our irrigation projects that someone else had put together for me. The fix was round about. I did some web searching, found the culprit was likely a pressure switch, ended up swapping the whole pump out, rewiring it the same, and […] ➡
- 2022
- Getting Beyond the AI Exuberance of Promptism I have to admit doing some bit of tossing phrases into one of the DALL-E Mini generators to gawk/shrug/tweet about what emerged. There is a bit of natural curiosity to either get a result that is a stunning graphic but what seems more common in my attempts… crap. So I like seeing my colleague Bryan […] ➡
- 2016
- The Water Knife Really Drove a Cadillac It did not take long to finish the last 44.2% of Paolo Bacigalupi’s The Water Knife I blogged abut two days ago. It definitely picked up in excitement like the rush of a flood over the rocks of a desert arroyo. I’m not going to talk much about the second half, no spoilers, but have […] ➡
- 2015
- Where is That Photo? Wow it has been a long time since I saw a Brunton Pocket Transit, probably back to grad school Geology. It may not have much relevance to the post, but I warm to the nostalgia. Maybe it does, because it was my study of Geology that got me thinking about something I saw online today. […] ➡
- 2012
- 2010
- Five Card Flickr Stories Bonus: See All Stories with One Photo I have a few upcoming presentations where I plan to use Five Card Flickr Stories so was compelled to try and toss a few more code tweaks onto the bin. The newest is an ability, when a story is published, to see for one one photo, all the other stories that it appears in. So […] ➡
- The “e” in ePub Does Not Stand for Easy cc licensed flickr photo shared by michael.heiss Given the rising tide/trend of electronic books, for a number of months I’ve been pondering how to make our NMC publications available in an ebook format. With the push of an iThing it looked like ePub was the format to aim for. It is after all, a standard […] ➡
- 2009
- Clippy Tweets! cc licensed flickr photo shared by cogdogblog You can tweet but you cannot hide. If you mention "Clippy" in a tweet, that *#&$ing paper clip will hear you and reply, in that "I’m trying to be helpful but am annoying as biting ants in your shorts" way. Try it. Tweet something snarky about Clippy. Insult […] ➡
- 2008
- Wikis and Pushups, like Anchovies and Oatmeal? There’s just somethings you don’t think of going together, but the web never fails to unveil, almost on a daily basis, an example of some use you would not have imagined the day before. So when Coop was visiting this weekend, she told me about a local group of Arizona folks participating in the 100 […] ➡
- Help Pack my (presentation) Bag For WordCamp As noted with much excitement last week, I am going to WordCamp August 16. It all got notched up a bit now when I got an email from Matt (yes that ma.tt – what a URL! I looked into getting al.an but the Dutch refused to go for such a short domain). Anyhow (with a […] ➡
- iFlickr Lots of new iPhone/iPod apps for accessing Flickr. Using now Exposure from connected flow (same folks that make iPhoto/aperature export plugin). Blogging from iPod for the fun of it! Share this barking on social media ➡
- 2006
- My Own URL After some intense days this week (three > 2 AM nights, more on that later), it was nice to kick back and just sift through some neglected RSS injected content in my aggregator. So I was reading Gardner Campbell describe In My Life, where he shares the moments of his transition from University of Mary […] ➡
- Earlier Patent The patent eager folks at Bb seemed to have missed a crucial earlier patent which usurps everything they claim: Socrates Awarded Patent on Learning Methodology ATHENS–(BUSINESS LIAR)–July 26, 440 BC–Socrates Inc. (NASDAQ:SOCRA), a leading provider of philosophical ideas and services to the education industry, announced that it has been issued a U.S. patent for the […] ➡
- 2005
- 2004
- Feed2JS Build and Style Tools Back to code. I modified the download-able version of our Feed2JS to provide local installations the same build and CSS select/modify tools we offer on the main site. The primary reason is getting it set up on a server in New Zealand for my pending visits there for workshops in November. This was a fairly […] ➡
- Kick the Dog About the Blog I asked for it. I got it. Some good, healthy, swift kicks regarding yesterdays 2 part frothy rants on This Ain’t No Blogging (parts 1 and 2), both via comments and trackbacks. Thanks Scott, Dan. Stephen, James, David, Rino (I think, I cannot read Norwegian), Brian, Tom and everyone else who decides to pile on. […] ➡
- 2003
- Amazon RSS Feed-Builder Although Boris recently blogged on a convoluted way to get RSS feeds from Amazon.com, there is a slicker interface from onfocus , the Amazon RSS Feed Builder. This site is by “pb” or Paul Bausch, “co-developer” of Blogger and author of Amazon Hacks, so definitely no slouch at the programming command line. It is the […] ➡
- MT Weblog as Courseware Simply wonderful. RIT professor Liz Lawley is doing some great things by (a) trying; and (b) sharing here efforts in using movabletype as courseware. A version of her Fall 2003 Introduction to Multimedia courseblog is available for peeking (her own mamamusings blog is worth looking at just to see what good work with CSS can […] ➡
- Games for Learning, What a Concept Both Stephen and George recently pointed to this bit from Wired News: Educators Turn to Games for Help. What an idea! … wait a minute, we took a look at Shall We Teach with a Game? back in 1994 at that time, with having our faculty review a selection of CD-ROM games for potential in […] ➡
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.
Share this barking on social media