2008-12-25 :-)
_ 朝ッ
0700起床
_ 仕事
0900 客先作業。
_ イトケンのアレ
チケット届いた
_ 題名のない音楽会 落選のお知らせ
はい次
_ [ffmpeg][NetBSD]ffmpeg を入れる
% cd /usr/pkgsrc/multimedia/ffmpeg % sudo make install clean-depends
: ---------------------------------------------------------------------- install -m 644 x264.pc /usr/pkg/lib/pkgconfig libtool --mode=install install x264 /usr/pkg/bin install .libs/x264 /usr/pkg/bin/x264 => Automatic manual page handling => Registering installation for x264-devel-20071218nb2 => Returning to build of ffmpeg-20080727nb4 => Full dependency lame>=3.96.1nb4: NOT found => Verifying reinstall for ../../audio/lame => Bootstrap dependency digest>=20010302: found digest-20060826 ERROR: This package has set PKG_FAIL_REASON: ERROR: lame-3.98.2 has an unacceptable license: lame-license. ERROR: To view the license, enter "/usr/bin/make show-license". ERROR: To indicate acceptance, add this line to /etc/mk.conf: ERROR: ACCEPTABLE_LICENSES+=lame-license *** Error code 1 Stop. make: stopped in /usr/pkgsrc/audio/lame *** Error code 1 Stop. make: stopped in /usr/pkgsrc/multimedia/ffmpeg
ACCEPTABLE_LICENSES+=lame-license を追加。
再度 make して終わり。
_ [Web::Scraper][Perl]Web::Scraper に入門した
use Web::Scraper; - 今日のCPANモジュール
scraper シェルを起動する。
% scraper "http://www.radionikkei.jp/healthy/ondemandlist.html"
Firebug :: Firefox Add-ons でごにょごにょしながら XPath を試す。
scraper> process '/html/body/div/div[2]/div[4]/ul/li/a', WARN; <a class="program-ondemand-link" href="/healthy/asx/healthy-081220.asx">ヘルシーメルシー☆(2008.12.20放送分)</a> <a class="program-ondemand-link" href="/healthy/asx/healthy-081213.asx">ヘルシーメルシー☆(2008.12.13放送分)</a>
href 属性を取得してみる。
scraper> process '/html/body/div/div[2]/div[4]/ul/li/a', 'url[] => @href'; Don't know what to do with url[] => @href => undef at /usr/pkg/lib/perl5/site_perl/5.10.0/Web/Scraper.pm line 145, <FIN> line 13.
間違えた。
こう。
scraper> process '/html/body/div/div[2]/div[4]/ul/li/a', 'url[]' => '@href'; scraper> y --- url: - !!perl/scalar:URI::http http://www.radionikkei.jp/healthy/asx/healthy-081220.asx - !!perl/scalar:URI::http http://www.radionikkei.jp/healthy/asx/healthy-081213.asx
Perl コードを出力してみる。
scraper> c #!/usr/pkg/bin/perl use strict; use Web::Scraper; use URI; my $uri = URI->new("http://www.radionikkei.jp/healthy/ondemandlist.html"); my $scraper = scraper { process '/html/body/div/div[2]/div[4]/ul/li/a', 'url[]' => '@href'; }; my $result = $scraper->scrape($uri); scraper>
すげえな。