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

September 1, 2008

How to send “Now Playing: Song” into any chat with a Hotkey

Posted in Intermediate at 10:31 pm by gloriouscomputing

I know what you want. You want to be more annoying to your friends on IRC and various IM clients!

That was my modivation for doing the following quick hack with AutoHotKey. AutoHotKey was basically designed to let you do all sorts of fun stuff with a hotkey.

I used to chat on BCDC++, which had the lovely command “/winamp”, which would send something like this to the chat “Bob is listening to: Funker Vogt – You Can Win If You Want”, because inquiring minds want to know.

After leaving college, and thereby the only useful place to use a DC++ hub, I’ve missed the “/winamp” command in my other chat clients, such as Pidgin.

So here’s how to get a hotkey to spam what song you are currently playing:

  • Install AutoHotKey, and make a new .ahk file, which you will run at startup
  • Set Winamp, or whatever player you prefer, to copy the current title of your song to the clipboard when you hit Ctrl+Alt+Num8 (or whatever you wish). In Winamp, you can do this under “Global Hotkey” Preferences, and then “General: Copy title”.
  • Add the following code to your AutoHotKey script

^!Numpad7::
Send /me is listening to “{Ctrl Down}{Alt Down}{Numpad8}{Alt Up}{Ctrl Up}{Ctrl Down}v{Ctrl Up}”{Enter}
return

That’s it! Now if you hit Ctrl+Alt+Num7 while in Pidgin, it will show:

***Bla is listening to “Modern Talking – You Can Win if You Want”