#!/usr/bin/perl use strict; use warnings; use Web::Scraper; use URI; use Term::Encoding; use Encode qw//; my $word = shift or die "Usage: alc.pl WORD N"; my $num = shift || 1; my $alc = 'http://eow.alc.co.jp/%s/UTF-8/'; die unless $word =~ /^[a-z\s]+$/i; my $res = scraper { process '//li[span[@class="midashi"]', 'list[]' => 'TEXT'; }->scrape(URI->new(sprintf $alc, $word)); $num = $#{$res->{list}} if $num > $#{$res->{list}}; for my $n ( 0 .. $num-1 ) { printf "%d. %s\n\n", $n+1, Encode::encode(Term::Encoding::get_encoding(), ${$res->{list}}[$n]); }
追è¨
ãã£ãã·ã¥ããæ¹ããµã¼ãã«ãåªãããã¬ã¹ãã³ã¹ãæ©ããªããªãã©ãããã®ãä¸çªã¹ãã¼ãã ããã
- UserAgentãMasayoshi Sekimura / LWP-UserAgent-WithCache - search.cpan.orgã§ç½®ãæãã
- Mattias Holmlund / HTTP-Cache-Transparent - search.cpan.orgã使ã
- ã¨ã£ã¦ãããã¤ãJonathan Swartz / Cache-Cache - search.cpan.orgã¨ãã§ãã£ãã·ã¥