Universal imagehost redirector

By Arvid Last update Nov 19, 2009 — Installed 17,723 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 41 posts, 20 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
roraz User

anybody got any code that would work for imagebam??

 
fnloser User

this makes shareapic work for me

{
name: 'shareapic',
url_regex: /http:\/\/(www.)?shareapic\.net\/content\.php\?id=([^&]*)(...,
rewrite: function (matchResults) {
var filename = '';
var id = matchResults[2];
for (var i = 0; i < 9-id.length; i++) {
filename += '0';
}
var location = 'http://www.shareapic.net/images/' + filename + id + '.jpg';
return location;
},
xpath: "//img[contains(@src, 'http://images.shareapic.net/images3/')]",
redirect: true,
},

 
Cyberbeing User

A few months ago I did a simple modification to the shareapic part of the script for the new naming convention and it seems to work most of the time (though sometimes you will get a 404 or Forbidden error).

{
name: 'shareapic',
url_regex: /http:\/\/(www.)?shareapic\.net\/content\.php\?id=([^&]*)(&owner=(.*))?$/,
rewrite: function (matchResults) {
var filename = '';
var id = matchResults[2];
for (var i = 0; i < 9-id.length; i++) {
filename += '0';
}
var location = 'http://images.shareapic.net/fullsize3/' + filename + id + '.jpg';
return location;
},
xpath: "//img[contains(@src, 'http://images.shareapic.net/fullsize3')]",
redirect: true,
},

 
anonymous_user User

Do you think you could add support for Joggs.com?

Its not an imagehost but itd be nice if clicking on the thumbnails would go straight to the images.

 
xad User

Any possibility in an update for this please so that it works with places like hidebehind? It's a great script but stopped working for various sites.

Thanks.

 
zagadka User

Line 295 of your script is not correct. Images are not hosted on www.shareapic.net, they are on images.shareapic.net.

 
HatastiX User

nothing happens on hidebehind.com :(

 
pooja Scriptwright

CAN ANYBODY HELP I MADE A JAVASCRIPT FOR MY COMMUNITY ITS WORKING FINE BUT I WANT BY ONE CLICK IN DESCRIPTION OF COMMUNITY ....HOW CAN WE DO THAT

PLZZZ HELP ME OUT

 
darodi Scriptwright

Thanks for your script! :)

Here is the code to add support for yourfilehost images.


{
name: 'yourfilehost',
url_regex: /http:\/\/www\.yourfilehost\.com\/media\.php\?cat=image&file=(.*?)/,
id: 'thepic',
redirect: true,
},

 
Zian User

Are there any chances this script will work in Opera browser? :)

http://www.opera.com/support/tutorials/userjs/u...

 
theaulddubliner Scriptwright

thanks for updating arvid - this script is a real time saver and 'annoyance avoider'

 
Arvid Script's Author

Sorry for being slow. Fixed support for uploadem. Thanks theaulddubliner and Thor.

 
theaulddubliner Scriptwright

yay !!!

that works great - thanks thor

 
Thor User

Ok theaulddubliner,

it's appear that uploadem have changed another time ;-)
try with this now

{
		name: 'uploadem.com',
		url_regex: /^http:\/\/(.*?\.)?uploadem\.com\/view.php\?/,
		xpath: "id('myright')/p[@align='center']/a/img",
		redirect: true,
		rewrite: function (res, link) {
			var th = link.getElementsByTagName('img');
			if (th = th[0]) {
				var thRegex = new RegExp(/^http:\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);
				var thres; 
				if (thres = thRegex.exec(th.getAttribute('src')))
					return "http://" + thres[1] + ".uploadem.com/" + thres[2] + "/" + thres[3];
			}
			return false;
		}	
}

P.S: nice girls ;-)

 
Thor User

Ok theaulddubliner,

it's appear that uploadem have changed another time ;-)
try with this now

{
		name: 'uploadem.com',
		url_regex: /^http:\/\/(.*?\.)?uploadem\.com\/view.php\?/,
		xpath: "id('myright')/p[@align='center']/a/img",
		redirect: true,
		rewrite: function (res, link) {
			var th = link.getElementsByTagName('img');
			if (th = th[0]) {
				var thRegex = new RegExp(/^http:\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);
				var thres; 
				if (thres = thRegex.exec(th.getAttribute('src')))
					return "http://" + thres[1] + ".uploadem.com/" + thres[2] + "/" + thres[3];
			}
			return false;
		}	
}

P.S: nice girls ;-)

 
theaulddubliner Scriptwright

i was missing the '}' but it still isn't working for me :(

here's a couple of links that don't work:
http://i2.uploadem.com/view.php?view=181790
http://i2.uploadem.com/view.php?view=181803

thanks for your help Thor

 
Thor User

Hi theaulddubliner,

i think you have a missing "}" after "return false"

    {   name: 'uploadem.com',
        url_regex: /^http:\/\/(.*?\.)?uploadem\.com\/view.php\?/,
        xpath: "id('showcode')/p[@align='center']/a/img",
        redirect: true,   
        rewrite: function (res, link) {
            var th = link.getElementsByTagName('img');
            if (th = th[0]) {
                var thRegex = new RegExp(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);
                var thres;    
                if (thres = thRegex.exec(th.getAttribute('src')))  
                  return "http://" + thres[1] + ".uploadem.com/" + thres[2] + "/" + thres[3];
            }   
          return false;   
        }
   }

anyway if you have once again the problem, post the "not working" url so i can try that ...

 
theaulddubliner Scriptwright

I must be missing something Thor as it still ain't working for me.

I have the following:

    {   name: 'uploadem.com',
        url_regex: /^http:\/\/(.*?\.)?uploadem\.com\/view.php\?/,
        xpath: "id('showcode')/p[@align='center']/a/img",
        redirect: true,
        rewrite: function (res, link) {
            var th = link.getElementsByTagName('img');
            if (th = th[0]) {
                var thRegex = new RegExp(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);
                var thres; 
                if (thres = thRegex.exec(th.getAttribute('src')))
                    return "http://" + thres[1] + ".uploadem.com/" + thres[2] + "/" + thres[3];
            }
            return false;
    }

 
Thor User

Yes, it work for me ;-)
anyway i've done a little fix because sometimes
the Regex don't work well ...
so replace this line

var thRegex = new Regex(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);

with this line
var thRegex = new RegExp(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);

 
Thor User

Yes, it work for me ;-)
anyway i've done a little fix because sometimes
the Regex don't work well ...
so replace this line
var thRegex = new Regex(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);
with this line
var thRegex = new RegExp(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);

 
theaulddubliner Scriptwright

thanks for posting thor but that ain't doing it for me - is it definitely working for you ?

 
Thor User

For the new uploadem.com search "uploadem" in the script and modify as follow (the first part from /* to */ is the old code).

		/* name: 'uploadem.com',
		url_regex: /^http:\/\/(www\.)?uploadem\.com\/view\//,
		xpath: "id('showcode')/p[@align='center']/a/img",
		redirect: true,
		rewrite: function (res, link) {
			var th = link.getElementsByTagName('img');
			if (th = th[0]) {
				var thRegex = new Regex(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/th\/(.*?)\/(.*)$/);
				var thres; 
				if (thres = thRegex.exec(th.getAttribute('src')))
					return "http://" + thres[1] + ".uploadem.com/" + res[2] + "/" + thres[3] + "/" + res[4];
			}
			return false;
		}
		*/
		name: 'uploadem.com',
		url_regex: /^http:\/\/(.*?\.)?uploadem\.com\/view.php\?/,
		xpath: "id('showcode')/p[@align='center']/a/img",
		redirect: true,
		rewrite: function (res, link) {
			var th = link.getElementsByTagName('img');
			if (th = th[0]) {
				var thRegex = new Regex(/^http\/\/(.*?)\.uploadem\.com\/(.*?)\/(.*?)$/);
				var thres; 
				if (thres = thRegex.exec(th.getAttribute('src')))
					return "http://" + thres[1] + ".uploadem.com/" + thres[2] + "/" + thres[3];
			}
			return false;
		}	

enjoy

 
theaulddubliner Scriptwright

uploadem.com is no longer working arvid

here's a couple of links for you to do your magic on: http://www.uploadem.com/view.php?view=101000, http://www.uploadem.com/view.php?view=101082

thanks

 
gabedibble Scriptwright

Author: Please check out User Script Updates - simply update the header of your script and your users will be able to receive change-notification when you improve this script

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel