From fdc008695863f9fc9445f0a09ec122ec743c1058 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 13 Nov 2011 09:22:24 -0800 Subject: [PATCH] use thumbs for sauce, close #327 --- 4chan_x.user.js | 8 ++++---- script.coffee | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 47e137777..5ab7f4b2f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -126,7 +126,7 @@ file: '', md5: '' }, - flavors: ['http://iqdb.org/?url=', 'http://google.com/searchbyimage?image_url=', '#http://regex.info/exif.cgi?url=', '#http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url=', '#http://imgur.com/upload?url='].join('\n'), + flavors: ['http://iqdb.org/?url=', 'http://google.com/searchbyimage?image_url=', '#http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url=', '#http://imgur.com/upload?url='].join('\n'), time: '%m/%d/%y(%a)%H:%M', backlink: '>>%id', hotkeys: { @@ -2170,11 +2170,11 @@ return prefix.match(/(\w+)\./)[1]; }); return g.callbacks.push(function(root) { - var i, link, prefix, span, suffix, _len, _ref, _results; - if (root.className === 'inline' || !(span = $('.filesize', root))) { + var i, link, prefix, suffix, thumb, _len, _ref, _results; + if (root.className === 'inline' || !(thumb = $('img[md5]', root))) { return; } - suffix = $('a', span).href; + suffix = thumb.src; _ref = sauce.prefixes; _results = []; for (i = 0, _len = _ref.length; i < _len; i++) { diff --git a/script.coffee b/script.coffee index adc012ae8..62f1e8fd1 100644 --- a/script.coffee +++ b/script.coffee @@ -55,7 +55,6 @@ config = flavors: [ 'http://iqdb.org/?url=' 'http://google.com/searchbyimage?image_url=' - '#http://regex.info/exif.cgi?url=' '#http://tineye.com/search?url=' '#http://saucenao.com/search.php?db=999&url=' '#http://imgur.com/upload?url=' @@ -1651,8 +1650,8 @@ sauce = sauce.prefixes = conf['flavors'].match /^[^#].+$/gm sauce.names = sauce.prefixes.map (prefix) -> prefix.match(/(\w+)\./)[1] g.callbacks.push (root) -> - return if root.className is 'inline' or not span = $ '.filesize', root - suffix = $('a', span).href + return if root.className is 'inline' or not thumb = $ 'img[md5]', root + suffix = thumb.src for prefix, i in sauce.prefixes link = $.el 'a', textContent: sauce.names[i]