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

**URL:** <https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963>\
**Category:** Package Announcements\
**Created:** [January 4, 2020, 2:03pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963 "2020-01-04T14:03:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshday/32/368_2.png) [@joshday](https://discourse.julialang.org/u/joshday)\
**Post date:** [January 4, 2020, 2:03pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/1 "2020-01-04T14:03:56Z")

</div>

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

```julia
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'."

```

> **[GitHub - joshday/XKCD.jl: Retrieve data from the xkcd webcomic](https://github.com/joshday/XKCD.jl)**
>
> Retrieve data from the xkcd webcomic. Contribute to joshday/XKCD.jl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [January 4, 2020, 2:24pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/2 "2020-01-04T14:24:56Z")

</div>

It’s not registered. **Why** is it not registered?!? 😄

---

<div class="post-metadata">

**Author:** ![joshday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshday/32/368_2.png) [@joshday](https://discourse.julialang.org/u/joshday)\
**Post date:** [January 7, 2020, 11:29pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/3 "2020-01-07T23:29:50Z")

</div>

[Fixed](https://github.com/JuliaRegistries/General/pull/7520).

Note the behavior has changed a little bit:

```julia
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"

```

---

<div class="post-metadata">

**Author:** ![joshday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshday/32/368_2.png) [@joshday](https://discourse.julialang.org/u/joshday)\
**Post date:** [February 3, 2021, 8:09pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/4 "2021-02-03T20:09:57Z")

</div>

Just chiming in to say XKCD.jl has new capabilities on master. Release coming soon!

 ![Screen Shot 2021-02-03 at 3.08.40 PM](https://global.discourse-cdn.com/julialang/original/3X/0/f/0fde16771055d90beee313bac962d8fe05307039.png)

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [February 3, 2021, 9:01pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/5 "2021-02-03T21:01:40Z")

</div>

Is there a way to view the comics within VS Code?

---

<div class="post-metadata">

**Author:** ![joshday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshday/32/368_2.png) [@joshday](https://discourse.julialang.org/u/joshday)\
**Post date:** [February 3, 2021, 9:11pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/6 "2021-02-03T21:11:36Z")

</div>

> Is there a way to view the comics within VS Code?

What’s shown above is just a `MIME"text/html"` show method for `XKCD.Comic`. Anything that can use that mimetype should work. I wonder if there’s a way to hack into the plot pane in the Julia extension.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [February 3, 2021, 9:28pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/7 "2021-02-03T21:28:02Z")

</div>

Good question. It looks like `display` is one way to open a plot in the plot pane. Unfortunately, it is not clear to me how it works.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [February 3, 2021, 9:46pm UTC](https://discourse.julialang.org/t/ann-xkcd-jl-retrieve-images-and-hover-text-from-xkcd-webcomic/32963/8 "2021-02-03T21:46:10Z")

</div>

Here is something that could be integrated into your package somehow:

```julia
using FileIO, ImageShow

url = "https://avatars.githubusercontent.com/u/9677184?s=460&u=9a169e34d4bb0c3f8a48cd0ecb01b23e388b031c&v=4"
"https://avatars.githubusercontent.com/u/9677184?s=460&u=9a169e34d4bb0c3f8a48cd0ecb01b23e388b031c&v=4"

download(url) |> load

```
