Last active
August 29, 2015 14:15
-
-
Save johnroyer/6481e092493e14c25399 to your computer and use it in GitHub Desktop.
8comic Image Link Grabber
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 8comicLinkGrabber | |
// @namespace zeroplex.tw | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @include http://new.comicvip.com/show/cool-* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function htmlRender(imgUrl){ | |
var html = '<tr><td>' + | |
'<p style="background-color: red; color: white;">' + | |
'<a href="{}" style="color: white; margin: 10px 10px; font-size: 20px;">{}</a>' + | |
'</p>' + | |
'</td></tr>'; | |
var output = html.replace(/\{\}/g, imgUrl); | |
return output; | |
} | |
$(function(){ | |
var $img = $('img[name=TheImg]'); | |
var html = htmlRender($img.attr('src')); | |
$img.parent().prepend(html); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment