ANN: XKCD.jl: Retrieve images and hover text from XKCD webcomic

I had a bit of fun this morning filling an obvious void in the Julia ecosystem:

using XKCD

XKCD.comic(552)
# Dict{Symbol,String} with 2 entries:
#   :imgsrc => "https://imgs.xkcd.com/comics/correlation.png"
#   :hover  => "Correlation doesn't imply causation, but it does waggle its eyebrows suggestively and gesture furtively while mouthing 'look over there'."
26 Likes

It’s not registered. Why is it not registered?!? :smile:

14 Likes

Fixed.

Note the behavior has changed a little bit:

julia> XKCD.comic()
JSON3.Object{Base.CodeUnits{UInt8,JSON3.VectorString{Array{UInt8,1}}},Array{UInt64,1}} with 11 entries:
  :month      => "1"
  :num        => 2251
  :link       => ""
  :year       => "2020"
  :news       => ""
  :safe_title => "Alignment Chart Alignment Chart"
  :transcript => ""
  :alt        => "I would describe my personal alignment as \"lawful heterozygo…
  :img        => "https://imgs.xkcd.com/comics/alignment_chart_alignment_chart.…
  :title      => "Alignment Chart Alignment Chart"
  :day        => "6"
6 Likes