This comes from the “I Did Not Expect to Spend Time Code Fixing This Tiny Thing But is It Ever Rewarding When a Hunch Pans Out” department.

I kind of blame/credit my good friend Roland Tanglao (subscribe to his blog, something I had lapsed on doing, bad dog!). I’ve known Roland since the early early Northern Voice days, and we always connected on being camera geeks who love posting to flickr.

I like teasing Roland a little bit as he seems to love his angled view aka tilt photos, always be tilting Roland. And he posts in great volume- that’s well over 230,000 photos in one of his flickr accounts.

So when I saw an angle in one of my own photos yesterday, rather than making it level as I normally do, I tilted it Roland’s way.

Tilting Your Way, Roland
Tilting Your Way, Roland flickr photo by cogdogblog shared into the public domain using Creative Commons Public Domain Dedication (CC0)

Being good natured, he replied back in earnest to one of my tweets today praising flickr

https://twitter.com/rtanglao/status/1346538393430151169

All of this led me back to an ongoing bet, back in 2018, he wagered that flickr would die by a certain date in April, and we would know when the API went out. I wagered that it would be still running.

https://twitter.com/rtanglao/status/861314012977348609

The stakes were high, the winner gets a free lunch paid for by the loser at Roland’s favorite eatery in Vancouver, the Boss.

As part of the fun, I created a fun little static HTML web site with a countdown timer marking the time until the wager would be settled. I used a simple Javascript library that runs a countdown clock.

The thing is, now that it’s three years after, it just has zeroes (more sophisticated libraries offer an end message). I was kind of clever with a background image of the famous flickr Bad Panda and my own photo of Roland (when we once really ate at The Boss).

The question "Will the flickr api be alive by the end of April 2018) above a series of blocks for Days, hours, minutes, seconds, all at 0 because the countdown is over.
The countdown is over, the 0000 is no fun.

I made a bet with myself, how fast could I tweak the simplyCountdown.js code to count how much time has passed since this date? I saw pretty quickly where it checks how much time is left between now and some date in the future. If this difference is 0, well, game over.

A bunch of javascript code, yawn.

So here was my quick quess, the check point for everything is the value of secondsLeft being the difference from the targetDate when er are counting down to), and the current time now.UTC-getTime()

My hunch was to change the timer from countdown to to countup from, I just needed to change the math in both lines to

And thus, it works! The counter will now keep going upward! See it just go and go and go at https://pechaflickr.net/bet/

I might have saved time if I had checked the newer version of the countdown script, it now offers a countup option.

But how less satisfying that is than just figuring it out myself!

Yes, this is how Alan’s day sometimes gets sidetracked, but if it’s the name of giving an fun elbow jab to a friend like Roland AND I can score a small technical win, it all is worth it.

Now, take bets what the counter will read by the time I actually get to collect my lunch at the Boss. Not soon enough, Roland! We will celebrate with a tilted photo or 20,000.


Featured Image: Who needs other photos? I had my own photo of a countdown clock spotted on the campus of Tec de Monterey in Guadalajara- it’s the amount of time left until a 30 year time capsule is to be opened.

The Long Countdown
The Long Countdown flickr photo by cogdogblog shared into the public domain using Creative Commons Public Domain Dedication (CC0)

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *