Created
June 23, 2009 15:22
-
-
Save tobynet/134587 to your computer and use it in GitHub Desktop.
This file contains 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 LDR with site thumbnail | |
// @namespace http://d.hatena.ne.jp/toby/ | |
// @description Show feed thumbnail in Livedoor Reader(or fastladder) | |
// @include http://fastladder.com/reader/* | |
// @include http://reader.livedoor.com/reader/* | |
// @version 0.1 | |
// ==/UserScript== | |
// referenced by http://la.ma.la/blog/diary_200610182325.htm | |
// based on http://d.hatena.ne.jp/tnx/20060716/1152998347 | |
// based on http://tokyoenvious.xrea.jp/b/web/livedoor_reader_meets_hatebu.html | |
(function(){ | |
var w = (typeof unsafeWindow == 'undefined') ? window : unsafeWindow; | |
var DEFAULT_THUMBNAIL_SIZE = { | |
'Small': {width: '70', height: '60' }, | |
'Medium': {width: '90', height: '70' }, | |
'Large': {width: '120', height: '90' }, | |
}; | |
var default_size = DEFAULT_THUMBNAIL_SIZE['Medium']; | |
var THUMBNAIL_API_URL = [ | |
'http://open.thumbshots.org/image.pxf?url=', // better? | |
'http://images.websnapr.com/?url=', | |
'http://capture.heartrails.com/?', | |
'http://api.thumbalizr.com/?url=', | |
'http://img.simpleapi.net/small/', // better? | |
'http://mozshot.nemui.org/shot?' | |
]; | |
var default_thumbnail_api_url = THUMBNAIL_API_URL[4]; | |
var before_img = ""; | |
var img_css = "vertical-align: top; border: 0px solid;"; | |
w.channel_widgets.add('site_thumbnail', function(feed){ | |
return [before_img, | |
'<img style="', img_css, '" src="', | |
default_thumbnail_api_url, | |
feed.channel.link, | |
'" width="', default_size.width, | |
'" height="', default_size.height, | |
'">', | |
].join(""); | |
}, "site thumbnail"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment