分页: 1 / 1

短地址网站

发表于 : 2010-08-17 11:37
eexpress

代码: 全选

● g 短 .opera/menu/exp.menu.ini 
Item, short.to.pl短网址=Execute program,"/home/exp/bin/short.to.pl","%l"
Item, tinyurl短网址=Execute program,"/home/exp/bin/tinyurl.pl","%l"

代码: 全选

#!/usr/bin/perl

$_=$ARGV[0];
s{(?<=^http:/)(?!/)}{/};
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech -> get("http://tinyurl.com/");
$mech -> submit_form(with_fields => {"url"=>$_} );
if ($mech->success()) {
$_=$mech->content();
/^copy\(\'(.*)\'\);/m;
print $1;
`echo $1|xsel -i`;
`aplay /home/exp/媒体/事件声音-et/weapon_pkup.wav`;
}

代码: 全选

● cat bin/short.to.pl 
#!/usr/bin/perl

$_=$ARGV[0];
s{(?<=^http:/)(?!/)}{/};
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech -> get("http://to/");
$mech -> submit_form(with_fields => {"url"=>$_} );
if ($mech->success()) {
$_=$mech->content();
/value=".*?"/;
$_=$&; s/value="//; s/"//;
print;
#复制结果到鼠标中键。
`echo $_|xsel -i`;
`aplay /home/exp/媒体/事件声音-et/weapon_pkup.wav`;
}

Re: 短地址网站

发表于 : 2010-08-17 11:41
eexpress
s{(?<=^http:/)(?!/)}{/};
是cfy的写法。

Re: 短地址网站

发表于 : 2010-08-17 12:22
x007007007
:em04 EE,这个有什么用

Re: 短地址网站

发表于 : 2010-08-17 12:37
eexpress
@@ 浏览器里面,链接上面,右键菜单,选下,鼠标中键就可以粘贴段地址给别人看。

Re: 短地址网站

发表于 : 2010-08-17 14:26
trigger

Re: 短地址网站

发表于 : 2010-08-17 14:28
trigger

Re: 短地址网站

发表于 : 2010-08-17 15:04
eexpress
我喜欢自己作这种简单的事情。
脚本,到处都可以用。

Re: 短地址网站

发表于 : 2010-08-19 12:55
lainme
to已经不能用了

Re: 短地址网站

发表于 : 2010-08-28 15:12
tusooa
额,wgetpaste多方便。

代码: 全选

tlcr: 0 庚寅年七月十九日 14:18:40 ~
● wgetpaste -c dog ~/.fvwm/config
Your paste can be seen here: http://paste.pocoo.org/show/255335/
tlcr: 0 庚寅年七月十九日 14:19:02 ~
● wgetpaste -u http://paste.pocoo.org/show/255335/
Your paste can be seen here: http://tinyurl.com/2dydg72
tlcr: 0 庚寅年七月十九日 15:02:38 ~
● 
你自己看看,哪个强大,(不过估计这个是Gentoo开发的。)

Re: 短地址网站

发表于 : 2010-08-28 19:52
eexpress
我的强大,常用的就几个,可以复合到一个脚本里面,就像我那paste-img.pl。
你说的这,没找到。

代码: 全选

☛ dog short.url.pl 
my $select="tinyurl";
my %web=(
        "to"=>{"url"=>"http://to/","cmd"=>'/value=".*?"/;$_=$&; s/value="//; s/"//;'},
        "tinyurl"=>{"url"=>"http://tinyurl.com/","cmd"=>'/^copy\(\'(.*)\'\);/m; $_=$1;'},
);
$_=$ARGV[0];
s{(?<=^http:/)(?!/)}{/};
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech -> get($web{$select}{url});
$mech -> submit_form(with_fields => {"url"=>$_} );
if ($mech->success()) {
$_=$mech->content();
eval $web{$select}{cmd};
print "=====> \e\[31m$_\e\[0m\n";
`echo $_|xsel -i`;
`aplay /home/exp/媒体/事件声音-et/weapon_pkup.wav 2>/dev/null`;
}

Re: 短地址网站

发表于 : 2010-08-28 23:22
tusooa
笨兔源里面没有。

代码: 全选

tlcr: 0 庚寅年七月二十日 23:16:36 ~/.zsh
● dog /var/abs/community/wgetpaste/PKGBUILD
# $Id: PKGBUILD 11984 2010-02-24 18:30:59Z jlichtblau $
# Maintainer: Jaroslav Lichtblau <[email protected]>
# Contributor: Jaroslav Lichtblau <[email protected]>

pkgname=wgetpaste
pkgver=2.16
pkgrel=1
pkgdesc="A script that automates pasting to a number of pastebin services"
url="http://wgetpaste.zlin.dk/"
arch=('any')
license=('custom')
depends=('wget')
optdepends=('xclip: interface to Xclipboard')
source=(http://wgetpaste.zlin.dk/$pkgname-$pkgver.tar.bz2 \
        http://wgetpaste.zlin.dk/$pkgname.example)
md5sums=('f270d87c5ea9939b2818d38f43b51936'
         '77392c788659cc648a59df2d239ebe19')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  install -D -m755 ${pkgname} ${pkgdir}/usr/bin/${pkgname} || return 1
  install -D -m644 _${pkgname} $pkgdir/usr/share/zsh/site-functions/_${pkgname} || return 1
  install -D -m644 ${srcdir}/${pkgname}.example ${pkgdir}/usr/share/${pkgname}/${pkgname}.example || return 1

# license
  sed -n '2,5p' wgetpaste > LICENSE
  install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
}
tlcr: 0 庚寅年七月二十日 23:16:50 ~/.zsh
● 
倒是arch里面有。