September 16, 2008

Turn Redirect Links into Direct Links – GreaseMonkey

Posted in Beginner, For Developers, Intermediate at 4:39 am by gloriouscomputing

The GreaseMonkey extension allows you to alter any website on the internet locally and automatically before Firefox shows it to you.

What I wanted was a script that would turn any link that looked like this:

http://dataminingrus.com/redir.php?bla=http://site-that-you-want.com/awesome.htm&pukeUpAdID=9343

into just the link:

http://site-that-you-want.com/awesome.htm

While I suppose http://dataminingrus.com would be unhappy about us going to our destination without reporting in (and possibly being forced to watch an ad before getting there), we’d be quite happy to bypass this step.

I couldn’t find a script that did this for any website, but I did find a script that did this for AltaVista.com only: AltaLink

Looking at the code, I kept the part about replacing links, and just changed the regular expression to one that I came up with myself. I’m no expert at regular expressions, but it looks like it works just fine.

Note that before you just blindly install this and run around with it on all the time: There are websites which use redirect links to avoid getting attention via link targets receiving “referring” urls. So if you are hanging out on some websites that wish to avoid publicity, you probably want to turn this script off for the admin’s sake. Personally, I only turn this script on while surfing sites which use redirect links to annoy users.

More importantly, this will rewrite all links that pass URLs as a parameter into a direct link to the parameter. Some sites choose to pass a link as a parameter that has nothing to do with where you will eventually end up. For sites like these, having this script on will break your browsing experience. So only turn this on for special occasions. 🙂

Download Global Direct-Linkifyer

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: