# ShortCodes.jl to embed content from Twitter, YouTube etc in Pluto

**URL:** https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147
**Category:** Package Announcements
**Tags:** package, announcement, pluto
**Created:** [February 27, 2021, 5:46pm UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147 "2021-02-27T17:46:03Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![hellemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hellemo/32/324_2.png) [@hellemo](https://discourse.julialang.org/u/hellemo)
#### Post date: [February 27, 2021, 5:46pm UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/1 "2021-02-27T17:46:03Z")

</div>

I’m using Pluto more and more for presentations, and like to include some videos, tweets or images to spice it up a little. While using embed codes from each website works fine, I started playing around with something along the lines of the [Hugo shortcodes](https://gohugo.io/content-management/shortcodes/). The result is [ShortCodes.jl](https://github.com/hellemo/ShortCodes.jl), which is pretty basic, but serves my current needs.

```julia
using ShortCodes

# Embed tweet by id
Twitter(1314967811626872842)

# Embed youtube video by id and seek to start time and pause 
# to show custom still image
YouTube("IAF8DjrQSSk", 2, 30) # 2 min 30 seconds

# Embed Flickr image by url
Flickr("https://www.flickr.com/photos/153311384@N03/29110717138")

# Share string, e.g. a url, with the audience of a presentation using QR code:
QRC("https://julialang.org/downloads/#current_stable_release")

```

As an example, the twitter embed should render something like this:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/b/4b7559b863d519608587b9bf28b9062c9cba5cba.png)

Let me know what you think, suggestions for improvements are welcome.

---

<div class="post-metadata">

### Author: ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)
#### Post date: [February 27, 2021, 8:46pm UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/2 "2021-02-27T20:46:20Z")

</div>

Cool stuff!

Isn’t it redundant to specify “[flickr.com](http://flickr.com)” for Flickr embeds?

---

<div class="post-metadata">

### Author: ![hellemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hellemo/32/324_2.png) [@hellemo](https://discourse.julialang.org/u/hellemo)
#### Post date: [February 27, 2021, 10:01pm UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/3 "2021-02-27T22:01:14Z")

</div>

Thanks!

Good point about Flickr, I guess since the API requires a url I just left it at that, but then so does Twitter. Perhaps the same trick could work for Flickr. I’ll have another look.

EDIT: The same trick seems to work for Flickr, did a minor update and now this should work:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/8/280ca1bb4256e3f33ec2fcc658799c55e36defe4.jpeg)

---

<div class="post-metadata">

### Author: ![lgmendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lgmendes/32/34577_2.png) [@lgmendes](https://discourse.julialang.org/u/lgmendes)
#### Post date: [January 5, 2023, 1:19am UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/4 "2023-01-05T01:19:18Z")

</div>

Any plan to commit an updated version of the shortcodes.jl compatible with the current version of Pluto?

---

<div class="post-metadata">

### Author: ![hellemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hellemo/32/324_2.png) [@hellemo](https://discourse.julialang.org/u/hellemo)
#### Post date: [January 6, 2023, 3:36pm UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/5 "2023-01-06T15:36:07Z")

</div>

I wasn’t aware there was a problem with newer Pluto versions. I just tried with Pluto version 0.19.19 on julia master and the first couple of things I tried worked as expected. Could you please open an issue on github with more details on any incompatibilities?

---

<div class="post-metadata">

### Author: ![lgmendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lgmendes/32/34577_2.png) [@lgmendes](https://discourse.julialang.org/u/lgmendes)
#### Post date: [January 6, 2023, 4:16pm UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/6 "2023-01-06T16:16:15Z")

</div>

Hi!  
The problem is that when I try to install ShortCode.jl using the Pkg.jl the version of Pluto is downgraded to 0.19.9. You probably need to update the github Project.toml file (?)

---

<div class="post-metadata">

### Author: ![hellemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hellemo/32/324_2.png) [@hellemo](https://discourse.julialang.org/u/hellemo)
#### Post date: [January 6, 2023, 9:14pm UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/7 "2023-01-06T21:14:32Z")

</div>

Oh, I see. `ShortCodes.jl` uses an older version of `HTTP.jl`, holding Pluto back. I’ve released a new version which should allow the same version as Pluto, please give it a try.

I typically don’t have ShortCodes and Pluto installed in the same environment, so I never noticed (just installing/using ShortCodes from the notebook).

---

<div class="post-metadata">

### Author: ![lgmendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lgmendes/32/34577_2.png) [@lgmendes](https://discourse.julialang.org/u/lgmendes)
#### Post date: [January 7, 2023, 12:00am UTC](https://discourse.julialang.org/t/shortcodes-jl-to-embed-content-from-twitter-youtube-etc-in-pluto/56147/8 "2023-01-07T00:00:32Z")

</div>

Thank you for the rapid reply!  
It’s working great!
