 : comic-image ( url -- image )
     http-get nip
     R/ \/\/imgs\.xkcd\.com\/comics\/[^\.]+\.(png|jpg)/
-    first-match >string "http:" prepend load-http-image ;
+    first-match >string "https:" prepend load-http-image ;
 
 : comic-image. ( url -- )
     comic-image image. ;

    xkcd-url comic. ;

: random-xkcd. ( -- )
    "http://dynamic.xkcd.com/random/comic/" comic. ;

: latest-xkcd. ( -- )
    "http://xkcd.com" comic. ;

TUPLE: xkcd number image ;


PRIVATE>

: xkcd-url ( n -- url )
    "https://xkcd.com/%s/" sprintf ;

: xkcd-image ( n -- image )
    xkcd-url comic-image ;
