_     _       _              
 ___| |__ (_)_ __ | |_ ___   ___  
/ __| '_ \| | '_ \| __/ _ \ / _ \ 
\__ \ | | | | | | | || (_) | (_) |
|___/_| |_|_|_| |_|\__\___/ \___/ 
      

ようこそ、僕のサイトへ

aboutblognetmusiccontact

#003: the quest for useless knowledge


2018年4月24日 (火)

The world is full of amazing things. One of them is the boundless expanse of useless knowledge. Another one is the mystical portal to this pool of random information: Wikipedia.

When things are going quite slowly around here, I enjoy mindlessly clicking on the 'random article' button on Wikipedia, in hopes of finding something that my tickle my brain, be inspiring, or at the very least, moderately entertaining. Unfortunately, this is an incredibly inefficient endeavor, as you may see if you just went to try it, it appears to be that almost all of the so-called 'random' articles are those of boring people or boring places.

In fact, just to make sure I wasn't spouting nonsense here, I gave it a single click to see what I might get - RKSV Leonidas, a football club from the Netherlands. The matter is so uninteresting that the entire page is two sentences, a reference in Dutch, and a permanently dead link to their official site. Clearly, the 'random article' button is far from an 'entertain me now' button. Yet, I find myself falling victim to its tempting ways too often, developing a mean carpal tunnel from the deranged clicks it lures me into. Every now and then, an article might be more than a 20 second read about something I will never think about again, and even more rarely, it might be something interesting. It is truly a lucky moment when the article is both extensive and interest-piquing, but that only happens oh so frequently.

But I've (sorta) found a solution.

On Wikipedia, there are pages called Categories. One such page will contain nothing but links to pages that are in that category. For example, on the Plants category, you may find the page Shrub listed. Neat. However, I am never in search of something specific, I just want to find something new that might be tangentially related to my interests. So, I compile a list of all the categories that might contain articles that interest me. From there, all I must do is pick a random category, and then from that, a random page.

To make things more interesting (as they are incredibly boring so far), instead of doing this manually, I wanted my computer to give me something to read. So, I checked via everyone's least favorite search engine if there was an easy-to-use API for Wikipedia, and to my notsurprise, there was. The one thing I needed to do was get a list of all the pages belonging to a category - which is the one thing this API didn't provide. (Really, this isn't the API, it's just a Python wrapper for the actual API.) So I decided to add the feature myself, which worked quite nicely. To make things even more fun, I decided to write a nice little front-end that allows you to manage your 'interest' (really just categories) easily. I can add or remove categories from my list of categories, and pop up a little tidbit on my desktop from an article in one of the categories as a desktop notification. So now, every 20 minutes, I get a desktop notification that looks like this:

Tidbit: Logic
Morton's fork

A Morton's fork is a type of false dilemma in which
contradictory observations lead to the same conclusion. It
is said to have originated with the collecting of taxes by
John Morton.

It's just the first two sentences from the 'Summary' section of the article Morton's fork, which is in the Logic category.

Essentially, the end result is this: a random fact that probably maybe might interest me shows up on my screen sometimes. You can grab the code from here.