Skip to content

Instantly share code, notes, and snippets.

@lackac
Created April 1, 2010 16:37
Show Gist options
  • Save lackac/352054 to your computer and use it in GitHub Desktop.
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.
// ==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