XKCD icon indicating copy to clipboard operation
XKCD copied to clipboard

Update xkcd.py

Open Vbbab opened this issue 3 years ago • 0 comments

According to this comment Even running xkcd without any args should get random comic. However, since XKCD's API (likely) has changed, the original else segment would always return a constant comic (in my case, https://xkcd.com/2392/)

Since (to my understanding) the --random flag was only there to enforce randomness (and not letting XKCD do the random selection) but the API has changed, this proposed change basically removes the if-else clause entirely, forcing a random comic every time. (And basically ignoring the --random flag subsequentially -- it's just there to maintain some sort of backward-compatibility, in case that would be used.)

Also improves code regarding randomization.

Vbbab avatar Dec 02 '20 23:12 Vbbab