代码: 全选
tlcr: 0 庚寅年七月二十日 11:48:25 ~
● ds scripts-eexp/mlinfo.perl
#!/usr/bin/env perl
# vim : ft=perl
use 5.010;
use Getopt::Long;
GetOptions('nocol' => \$nocol, 's'=>\$short);
$shortlen=10;
open (STDERR, ">/dev/stdout");
use LWP::Simple;
$_ = get("http://localhost:4080/submit?q=vd");
die "Couldn't get it!" unless defined $_;
/<table.*\/table>/s;
use HTML::TableExtract;
$te = HTML::TableExtract->new(depth => 1, count => 1);
$te->parse($&);
foreach $ts ($te->tables) {
foreach $row ($ts->rows) {
next if ! @$row[5];
if($short){@$row[5]=substr(@$row[5],0,$shortlen);}
if(! $nocol){
$_="\e[4;32;40m@$row[5]\t\e[4;31m@$row[8]%\t@$row[15]KB/s\e[0m";
} else {
#$_="@$row[5] \t@$row[8]%\t@$row[15]KB/s\n";
$_="@$row[5]\t@$row[8]%\t@$row[15]KB/s";
}
s/\s*\t/\t/gs;
say;
}
}
close(STDERR);
tlcr: 0 庚寅年七月二十日 12:00:03 ~
● ds scripts-eexp/ansi2conky.perl
#!/usr/bin/env perl
%colors = (
0 => 'black',
1 => 'red',
2 => 'green',
3 => 'yellow',
4 => 'blue',
5 => 'magenta',
6 => 'cyan',
7 => 'white',
);
$_ = join "",<STDIN>;
$_ .= "\${color}";
s/\e\[0m/\${color}/g;
s/\e\[0[01]m//g;
s/\e\[[0-9;]*?3(\d)[0-9;]*?m/\${color $colors{$1}}/g;
s/\${color}\s*(?=\${)//g;
print;
tlcr: 0 庚寅年七月二十日 12:00:19 ~
●
代码: 全选
tlcr: 0 庚寅年七月二十日 12:00:19 ~
● mlinfo.perl -s
slackware- 89.6% 48.7KB/s
tlcr: 0 庚寅年七月二十日 12:00:42 ~
● mlinfo.perl -s -n
slackware- 89.6% 48.7KB/s
tlcr: 0 庚寅年七月二十日 12:00:44 ~
● mlinfo.perl -s | ansi2conky.perl
${color green}slackware- ${color red}89.6% 48.7KB/s${color}% tlcr: 0 庚寅年七月二十日 12:00:48 ~
●
代码: 全选
tlcr: 0 庚寅年七月二十日 12:00:48 ~
● rr-RSS.perl
${color green}骨头的博客:${color yellow}
gentoo下的pppoe拨号
湿地博物馆
${color green}xiooli的博客:${color yellow}
诡异的 gtk 程序启动出错
迁移运行中的 Archlinux 系统至移动硬盘
tlcr: 0 庚寅年七月二十日 12:01:45 ~
●
代码: 全选
tlcr: 0 庚寅年七月二十日 12:02:44 ~
● sed -n '81,86p' < ~/.conkyrc-rss
TEXT
${color}RSS${stippled_hr}
${color yellow}${execpi 600 rr-RSS.perl} # | sed -re 's/.{29}/&\n/g'}
${color}MLDonkey 状态${stippled_hr}
${color red}${exec mlinfo.perl -s | ansi2conky.perl}
tlcr: 0 庚寅年七月二十日 12:03:00 ~
●