用书签压缩你当前访问的页面地址

Posted on May 23, 2009 by Fdream

正式开始twitter了,我的twitter地址是:http://twitter.com/xushengs,欢迎加入!

由于twitter的字数有限制,因此把长URL压缩成短URL是非常非常必要的。不过,你是不是因为压缩的工作而烦恼,要复制地址,然后粘贴,然后再复制,再粘贴?用书签来替你完成前面的工作吧!

把下面的这个地址拖到你的书签栏就OK了:

Compress URL

如果不能拖到书签栏,请新建一个书签或者把当前页面加入收藏,然后更改这个书签的属性,把URL地址更改为:

javascript:void(function(){var r='http://is.gd/api.php?longurl='+encodeURIComponent(location.href),x=function(){if(!window.open(r,'ShortURL','toolbar=0,resizable=1,scrollbars=yes,status=1,width=320,height=240'))location.href=r};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()

使用方法(需允许弹出窗口):

  • 打开你要进行URL压缩的页面
  • 点击这个书签按钮
  • 在弹出的窗口中全选:Ctrl + A,复制:Ctrl + C

本来想把这个Ctrl + A也去掉来着,要写的代码有点长,后来发现还有问题是[http://is.gd]is.gd[/url]提供的这个API输出的是纯文本,不是HTML DOM,要做也很麻烦,先这样吧,已经省了一半的工作了。

分享 |
Categories:
Ajax Web
Tags:
,
Comments:
7 Comments
Views:
3,134 Views

Related Posts

7 Responses to <用书签压缩你当前访问的页面地址>

  1. j says:

    可以试下这个, 用的是bit.ly的api
    http://api.bit.ly/shorten?version=2.0.1

  2. tea味 says:

    :D 说的不错!
    国内的免费URL压缩服务http://591.hk.cn,支持多个长地址同时压缩成一个短地址!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>