Created
April 1, 2010 16:37
-
-
Save lackac/352054 to your computer and use it in GitHub Desktop.
Adds a title command to the xkcd.com's cli which prints the last comic's title. It's a Greasemonkey script, use the raw version and it installs if you have Greasemonkey/GraseKit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name XKCD title command | |
// @namespace http://icanscale.com | |
// @description Adds a title command to the cli which prints the last comic's title | |
// @include http://xkcd.com/* | |
// ==/UserScript== | |
(function() { | |
if (typeof unsafeWindow == 'undefined') { | |
var unsafeWindow = window; // for being able to use this as a bookmarklet | |
} | |
var $ = unsafeWindow.jQuery; | |
$(function() { | |
unsafeWindow.TerminalShell.commands.title = function(a) { | |
a.print($('.comic:last').attr('title')); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment