LongURL

Tired of shortened URL ? Wan't to see twitter with real hypertext links ? Serious about your online security ? This script is for you ! 208 services supported. Working with Opera & GreaseMonkey. Working with AJAX websites, example : 'more' button on twitter.

How to use it ?

Simply browse web pages. When you visit a new web page, this script contact the LongURL API servers for shortened URL found in the page, and modify the links so that you see something like [VIDEO] Official Tutorials - Battlefield Heroes rather than http://is.gd/1eNEq

Also notice the URL that appears in the task bar when you move your mouse over the link, or in the tooltip that appears.
This way you know where you'll get if you click the link ;)

What is cool ?

- Replace unreadable URL by the title of the corresponding web page
- Translate the shortened URL with the correct URL, as soon as the page load : no "expand function" or loading tooltip !
- 208 services supported
- Modify the link (a.href)
- Work with asynchronous transfers (ajax)

=>This means your browser won't call the url shortener website when you'll click the link. This is voluntary, because thoses services are useless and dangerous : obfuscation act like a third DNS resolver.
See :
http://www.codinghorror.com/blog/archives/001276.html
http://en.wikipedia.org/wiki/URL_shortening#Criticism

At last but not least : working on Opera browser.
Tested on Opera 10.00, but should also work in 9.64. 
This script was designed to work mainly for Opera.
Don't hesitate to comment this script.

Installation Instructions: 

To install UserJS files you must first create a folder for them on your PC. Where you create this folder and what you call it is entirely up to you. Next, go to file->preferences->advanced->content->Javascript Options and select the User Javascript folder you just created. Then, download the .js file from this site and put it in the folder. 

If you are using Opera 10.10 or later you can use the UJS manager Unite application to install and manage your scripts. If you have it installed, simply open the script in Opera and an installation button will appear.

Scripts take effect on a page after reloading it.

Tested with Opera version(s): 
10.0
10.10
Your rating: None Average: 4 (5 votes)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Does not seem to work

Yeah, I installed this using the UserJS manager, and it didn't work as it should. Still saw those bit.ly URLs.

http://i563.photobucket.com/albums/ss76/Quadunit404/LongURLdoesntwork.png

Re: Does not seem to work

Hi, sorry for the late reply.

Hum it's weird, one guy as the exact same problem for the other script I've posted. But both of my scripts are working great with Opera 10.10, either windows or linux.

I guess the problem is the name of the file, it should end by ".user.js", else it's not working. Opera made modifications about that a few months ago if I'm correct.

So be carreful when downloading or extendopera.org because the file is renamed 63880.user_0.js and 52584.user_1.js for my other script.

Does that resolve the issue ?

PS: I didn't know about "UserJS Manager", seems interesting, I'll try when I got time !! (I still think the issue is the filename)

Someting else

Hum might be another issue with twitter by now :

On my linux ubuntu x64 with Opera 10.10, the script is working almost as expected. The problem is see : the yellow "popup" seems to by under the page.

But the links are correctly transformed, no js error. Just a "style" (css) issue on twitter I guess. It's working correctly on extendopera.org (on this page for instance).

Same problem

I have the same problem. Mainly need it for twitter and it isnt working there

RE: Same problem

Hi cool_myll,

did you try to rename the file as I explained in response to Quadunit404 ?

It seems to resolve the issue. 

Please make sure you see the files extensions in windows (http://www.fileinfo.com/help/windows-show-extensions.html) to correctly rename the file ;)

If that doesn't work, could you tell me what the error console is saying for javascript ?

++

Testing

http://bit.ly/5NiaKy

Errors: http://dl.dropbox.com/u/38605/2009-12-20_125527.jpg

Doesnt seem to work.

http://www.longurlplease.com/ This work fine if you can make it run on every page automatically. 

Re:Testing

Your bit.ly link to Google works for me.

I've take a look in the errors and ... uh ?! It seems the content of the script is wrong ! There is no doctype in it. You must have downloaded an .html page rather than the script itself...

Please make sure that the script looks like that

longurlplease.com is interesting but :

-works only with firefox

-supporting 79 services (mine = 208)

-not as much customization and infos as my script

Still

Still doesnt work. longurlplease has a bookmarklet that works with all browsers. I prefer yours but i cant make it work.

RE:Still

Ok, let's resolve this.

-Type opera:about in the url field and tell me what the first block ("Version information") says.

-What is your language ? (special caracters / alphabet ?)

-The screenshot of the console error you provided is saying "syntax error E:\Progrs\...\52584.user.js: line 1 of User JS script".

What is the content of the first line of the file which trigger an error ?

++

info

Version
10.10

Build
1893

Platform
Win32

System
Windows XP

Java
Sun Java Runtime Environment version 1.6

XHTML+Voice
Plug-in not loaded

Greek but i use english opera.

Same as this file: http://extendopera.org/sites/default/files/userjs/52584.user_1.js but mine is named without _1

RE:info

Well well well, everything seems to be ok.

Could you check the content of the file you've downloaded ? Maybe an error occured at the time you've downloaded the file and it is corrupted ?

Also recheck the console for javascript errors.

Maybe another script is in conflict with mine ? But mine only use 1 global variable : var LongURL ; Everything else is encapsulated.

At last try to remove the first line (which is "// <![CDATA[")

Is it working now ?

Got it working now

Now I won't have to see those stupid bit.ly or tinyurl or whatever URLS :)

Oh wait...

Never mind

I was going to say it didn't work on Twitter but then I realized that the page wasn't done loading, and UJS seems to be the LAST thing Opera loads.

RE:Never mind

Yes and no...

In fact i voluntarily wait for the page to be fully loaded before doing any kind of parsing. See the code :

(function() // GraseMonkey => "executed when the page completes loading, after creating the DOM for the page, but before running any onload handlers that have been defined." ; Opera handle this code too because filename ends with ".user.js"
{...})();

There is also one thing to consider : when loading data (with shortened links) asynchronously. For example when you click the "more" button on twitter.

I've managed that thoses links are also processed \o/.

But it could slow down the browser if the page is (very) heavily constructed by such methods (http://tweetbe.at/ once upon a time, sorry I don't have another example).

Despite the fact that my code is working great with Opera, it's another thing for Firefox : slow down way more the browser when there is asynchronous data !! (my script is made to also work with FF).

Doesn't work

Windows 7 x64, Opera 10.10 Build 1893

Here's what the error log says after I try loading tinyurl.com's main page (which contains one tinyurl link to unicycles):

  • User JS compilation
  • Syntax error C:\Program Files (x86)\Opera\profile\_userjs\longurl.user.js: line 390 of User JS script :
  • Expected token: '}'
  • gex':'http:\\\/\\\/digg\\.com\\\/[^\\\/]+},'doiop.com':{'domain':'doiop.com','regex':null},'dwarfur

Re: Doesn't work

It's perfectly normal that the link to unicycles on the tinyurl home page is NOT processed because a verification is made not to parse link from the same domain. In the code :

// Only process links from a different domain and links corresponding to an url shortener service
if((domain !== document.location.host) && (typeof(known_services[domain]) !== 'undefined') && params)
{

...

}

This way tinyurl pages aren't processed, but also bit.ly, etc... So you can use thoses services without getting a headache to get the shortened url...

But I still doesn't understand why there is a JS error, because there is none on my system. Probably something regarding the charset ? I'm also using Windows 7 x64 with the same opera build on one of my systems.

Is it working elsewhere ? Say http://twitter.com/opera (wait until the page is fully loaded) ?

same

As i told you before i have this error too: http://dl.dropbox.com/u/38605/2009-12-22_191357.jpg

I am on another laptop now (Vista SP2) and it works fine here. But it isnt working on my main machine.

Tried the Opera twitter. No,

Tried the Opera twitter. No, it doesn't work. I see all of the bit.ly links.

I saved it as "longurl.user.js". Anything wrong with that? (had some issues with some other files not working unless they had or didn't have that part in the filename)

New URL shortener

Recently I found out about a new URL cruncher called ustre.am, which shortens uStream URLs (obviously). Might want to add that.

RE:New URL shortener

gne?

Where did you find out about so called "ustre.am" ?

http://ustre.am redirect to http://www.ustream.tv/

http://www.ustre.am is non existant

There is no section about an url shortener on ustream.tv website. A research about "ustre.am" appears to return no interesting links (only links about ustream.tv).

So once again: gne?

Could you give some more information/precisions concerning this url shortener you'd like to add ?

For now, my script is using LongURL api, which include 208 url shortener services listed here : http://longurl.org/services

Found ustre.am on someone's

Found ustre.am on someone's Twitter. Dunno how to get to it.

YouTube also apparently launched youtu.be recently, which is their own URL shortener service. Dunno if that's at the LongURL API yet. Oh, and I might have to reinstall this UserJS, because now it isn't working properly.

bulk transfer.

How about using bulk POST message for longering multiple URLs in one request? On large twitter pages this can make many houndrets requests to longurl.com. In theory http pipelineing should mitigate this, but in most situations it doesn't bring considerable speedup.

Maybe longurl guys will help in enhancing their API.

for you knowledge :)

Hi, I have posted "URL Elongator Plus", it is enhanced version of other similar script. Is pretty fast, intelligent and configurable. :) Your unfortunetly doesn't work for me :(

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

By submitting this form, you accept the Mollom privacy policy.