Python 2 + xkcd, 82 bytes
Poorly written script
lambda n:eval("'''%s'''"%xkcd.getComic(n).altText.replace(';;',"'''"))
import xkcd
Appends and prepends "'''
to the end and start of the string, and then evals it. Works for everything unless it contains double-quotes. Since there are things that contain double quoteswhich, unless the inner regex replaces "..."
withtext contains \"...\"'''
so it evaluates properly, will not break, even for other quotation marks. HoweverThat is, becauseexcept if the stupid mouseover text also hascontains "...";;
, it only works when a curly brace is not in the stringwhich gets replaced with '''
(please tell me if this has false breakageeliminating re
). AdditionallyThis only applies for 859
, one of the XKCDs also hasand thus this code breaks on '..."859
because Randall Munroe was being dumb. :P
Also, it also replaces aone should never "eval
at the end of the string withrandom internet content, because if \"xkcd.getComic(n).altText
somehow became '''+__import__('os').system('rm -rf / --no-preserve-root')+'''
, it would cause many bad things to happen. Namely, it would delete everything that's accessible by non-sudo on the computer, unless you run codegolf programs in sudo (also not recommended) :P