TinyURL Decoder
TinyURL を使って作られている URL をオリジナルの URL に戻すユーザースクリプトを書いてみました。Greasemonkey :: Firefox Add-onsから Graeasemonkey をインストールした上で
http://userscripts.org/scripts/show/40582
をインストールすると、

のように TinyURL で圧縮されている URL が

というように元の URL が表示されるようになります。
http://userscripts.org/scripts/show/40582
をインストールすると、

のように TinyURL で圧縮されている URL が

というように元の URL が表示されるようになります。
ちなみに同じようなものはいくつかあるようなのですが、このスクリプトでは GM_xmlhttpRequest() の onload の中でレスポンスの中の finarUrl を使っています。また、同じ URL の場合には何度も元 URL をチェックするのは無駄なので、連想配列で cache を持つようにしていています。このキャッシュの長さはデフォルトでは 100 個にしていますが、 about:config から greasemonkey.scriptvals.http://matatabi.homeip.net/TinyURL Decoder でフィルタをかけると maxlength というのがあるので、ここで 10 とか 1000 とか好きな値に変更することができます。
Posted at 10:16
by setomits
http://sites.google.com/a/snaplog.com/wiki/short_url_hints
I would like to hear your thoughts.
r.S.
I read your proposal and felt that it might be useful for some situations.
I have thought about the problem for a couple days.
There are several services to shoten URLs and their shortened URLs. I think it is good for us to have options which service we use.
Anyway, it may be good for us that there is only one canonical URL. So it might be helpful to use META with rel="canonical" proposed at Official Google Webmaster Central Blog: Specify your canonical.
Thank you.
Thank you for your report.
This script uses some Greasemonkey APIs like GM_setValue, GM_getValue, GM_log and GM_xmlhttpRequest, so the version of Greasemonkey might concern with your problem.
I'm not sure whether I try to solve it or not, but could you let me know the version?
Thanks.
I will check it, so please wait for a while.
Thank you.
Please consider the following chages which work for me:
function request_for(a) { var a_href = a.href; if (a_href.indexOf('?') > 0) { a_href = a_href.substring(0, a_href.indexOf('?')); }then use a_href instead of a.href in the complete request_for function andonload: function(resp) { finalUrl = extract_from_response(resp); if (_node.href.indexOf('?') > 0) { finalUrl = finalUrl + _node.href.substring(_node.href.indexOf('?')); } if (finalUrl) {Thanks & Regards,Andreas
Thanx a lot!!
Nice script
I added TheCow in supported.
Enjoy it!
http://www.hleraweb.xpg.com.br/twitter/Tweets-URL-Decoder-v1-Beta[By-BGyn].zip
From: @BGyn
I just don't know the service.
I will support it.
Anyway, it looks good for me to use auto update scheme or such kind of things.
Please can you add support for t.co and goog.gl?
Thank you for your comment.
I added t.co and checked the script after a long time.
Now lots of services are not run right now, and deleted them to be supported. Please reinstall it from http://userscripts.org/scripts/show/40582.
Anyway, that script looks work with goo.gl. If you have know any tweet URLs on which goo.gl are not decoded, please let me know.
Actually saying, I don't use the script any more. New Twitter UI decode the shortened URLs, and I basically use Mac app version. So I don't notice if the script works or not.
Anyway, thanks for listening. :o)
function decode_shortened_url(_node) {
if (cache[_node.href]) {
/* cache[_node.href] = cache[_node.href].replace('&', '&'); */
if (GM_getValue('keep_text') === true) {
Please add the commented line, as it does not replace & in target URL
Thanks.
When we talk about entity references on HTML based system, it should be complicated.
Could you email me?
If you have some examples which are not decoded well, please contain them.
My email address is setomits at gmail dot com.
I started developing this Grease Monkey script because I hated that I have no idea where shortened URLs bring me unless I click them.
In the other hand, the youtu.be URLs must bring us to YouTube, right? It's the reason why I wont.