Skip to content

Instantly share code, notes, and snippets.

@johnroyer
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnroyer/6481e092493e14c25399 to your computer and use it in GitHub Desktop.
Save johnroyer/6481e092493e14c25399 to your computer and use it in GitHub Desktop.
8comic Image Link Grabber
// ==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