Created
August 24, 2009 08:06
-
-
Save satyr/173735 to your computer and use it in GitHub Desktop.
Opens Midori-san in a new tab.
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
0,function(){{} | |
const URL = 'http://www.smbc.co.jp/midorisan/'; | |
CmdUtils.CreateCommand({ | |
name: 'midorisan', | |
description: 'Opens '+ 'Midori-san'.link(URL) +' in a new tab.', | |
author: 'satyr', license: 'MIT', | |
icon: 'http://www.smbc.co.jp/favicon.ico', | |
arguments: {object: noun_type_number, goal: /^\d+/}, | |
execute: function({object: {data: from}, goal: {text: to}}){ | |
var me = this; | |
if (to) me._open(from, +to); | |
else $.get(URL, function(h){ | |
me._open(from, +/<div id="top">(\d+)/(h)[1]); | |
}); | |
}, | |
_open: function(f, t){ | |
var page = ('data:text/html,<!--midorisan-->'+ | |
'<base href="'+ URL +'images/"/><center>'); | |
for(let i = f; i <= t; ++i) | |
page += '<img src="'+ i +'_t.jpg"/><br/><img src="'+ i +'.jpg"/><hr/>'; | |
Application.activeWindow.open(Utils.uri(page)); | |
}, | |
}); | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment