PER MØLDRUP-DALUM

Never miss another xkcd

Maj 8, 2014

Lately I’ve been forgetting to check xkcd thereby not being in on the loop at my office. Therefore:

#!/usr/local/bin/MathematicaScript -script

(* get today's xkcd as it is defined in it's JSON data *)
json=Import["http://xkcd.com/info.0.json", "JSON"];

Export[$HomeDirectory <> "/Data/xkcd.png",
    Labeled[
        Import["img" /. json,"PNG"], (* get the comic strip *)
        Style[
            "alt" /. json,           (* extract the alt-text *)
            Background->LightYellow]]]

A launchd configuration, created with Lingon, to refresh the image file each day and a GeekTool setup that places the daily generated image on the top left corner of my Desktop.

Desktop, Vim, and Mathematica

Desktop, Vim, and Mathematica