Large

Show Just Image 2

By timendum Last update Jun 24, 2011 — Installed 299,810 times.

add request - jpgmag.com

in
Subscribe to add request - jpgmag.com 2 posts, 2 voices



Eric Howard User
FirefoxWindows

Here's a sample URL:
http://jpgmag.com/photos/2076633

And here's the code:

case 'jpgmag.com':
var container = document.evaluate('//div[@id="photo"]/div',document,null, 9, null).singleNodeValue;
if (container) {
var styleValue = container.attributes.getNamedItem('style').nodeValue;
var matches = styleValue.match('(http:\/\/)([a-zA-Z0-9]*)(.cdn.cloudfiles.rackspacecloud.com\/)([A-Za-z0-9\_]*)(.jpg)');
if (matches && matches.length > 0) {
location.href = matches[0];
}
}
break;

 
timendum Script's Author
FirefoxWindows

Added in 2.2.14.

But take a look at this code ;)
var style = xPH('//div[@id="photo"]/div/@style').value;
if (style && style.match(/background: url\("?([^\)"]+)"?\)/)) {
imgURL = style.match(/background: url\("?([^\)"]+)"?\)/)[1];
}