XKCD
XKCD copied to clipboard
Update xkcd.py
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.