Log in

No account? Create an account
Github "gist" integration with Livejournal - Tobin's Lab Notebook [entries|archive|friends|userinfo]
Tobin Fricke's Lab Notebook

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Github "gist" integration with Livejournal [Feb. 27th, 2013|06:28 pm]
Tobin Fricke's Lab Notebook
[Tags|, ]

It turns out that Livejournal recognizes github gist URLs, and will "embed" the resulting gist into an LJ entry.

Here's the relevant changelog: http://changelog.livejournal.com/16367242.html It's all done in javascript.



[User Picture]From: alexander_mikh
2013-02-27 05:31 pm (UTC)
gist loading error - what I see
(Reply) (Thread)
[User Picture]From: nibot_lab
2013-02-27 05:32 pm (UTC)
yeah, me too - although it seems to be working on other posts:

(Reply) (Parent) (Thread)
[User Picture]From: nibot_lab
2013-02-27 05:34 pm (UTC)
Ah, I see, it works with old gist URLs like https://gist.github.com/3861703 but fails for the new "namespaced" urls like https://gist.github.com/tobin/3861703 .
(Reply) (Parent) (Thread)
(Deleted comment)
From: jefftrull
2013-05-23 02:20 am (UTC)
Is there any way to inhibit this behavior? It's a neat idea, but some of my older gists are very large and make the resulting entry quite ugly to view.
(Reply) (Parent) (Thread)
[User Picture]From: nibot
2013-05-27 01:05 pm (UTC)
I found a kind of stupid workaround. If you can modify the URL so that it doesn't match the regular expression that LJ uses to detect gist links, then it won't embed the gist.

Instead of:

You can put an (otherwise unneeded) username in there:


And now it won't trigger LJ's gist-detection, but it's still a valid URL.
(Reply) (Parent) (Thread)
From: jefftrull
2013-05-27 03:49 pm (UTC)
Worked perfectly! Thank you.
(Reply) (Parent) (Thread)
[User Picture]From: jcreed
2013-07-29 12:22 am (UTC)
thanks a ton for this!
(Reply) (Parent) (Thread)
[User Picture]From: atykhonov
2013-09-06 10:13 am (UTC)
Does it still work? I put gist javascript but the gist doesn't expand...
(Reply) (Thread)