2008
Sep
1st
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 by setomits at 10:16 |
Comments: 10
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