kuxun.cn 刷票
下载: ticket.pl
- #! /usr/bin/perl -w
- use strict;
- use Term::ANSIColor qw(:constants);
- my $char = "卧";
- while (1)
- {
- my $i = 0;
- for ( $i=0; $i < 5; $i++)
- {
- my $ret = `curl -s http://piao.kuxun.cn/beijing-changsha/p$i`;
- my @lines = split('\n', $ret);
- my $date = $ARGV[0];
- foreach (@lines)
- {
- if (/<a(.*)a>/ig && /$date/ && /$char/)
- {
- print RED "$2\n", RESET "$1\n\n" if /href="(.*)" title="(.*)\" target="_blank"/;
- }
- }
- }
- sleep 30;
- system("clear");
- }
Example: perl ticket.pl 2-5
没有评论 ▼