Skip to content

Instantly share code, notes, and snippets.

@maripo
Created May 16, 2012 06:23
Show Gist options
  • Save maripo/2708018 to your computer and use it in GitHub Desktop.
Save maripo/2708018 to your computer and use it in GitHub Desktop.
Expand shortened URLs on Twitter (userscript for Firefox and Google Chrome)
// ==UserScript==
// @name ExpandShortURLs
// @namespace maripo.org
// @description Expand shortened URL on Twitter
// @include https://twitter.com/*
// @version 1
// ==/UserScript==
(function()
{
setInterval (function()
{
var links = document.getElementsByTagName('A');
for(i=0; i<links.length; i++)
{
link = links[i];
attr = link.getAttribute('data-ultimate-url');
if (attr)
{
link.innerHTML = decodeURIComponent(attr);
link.href = attr;
}
}
},
1000);
}
)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment