otsune's SnakeOil RSSフィード

python -c "print''.join([chr(x) for x in 111&1101,110+~-~11,10^11*11,110+~-~11,-~101,-~11^11*11,~-110,111&11*11,11+11+10,11|~-0110,1-~11^11*11,10^11*11,-~11^11*11,110,101])"

2008-12-17

サイエンスチャンネルのRemedie設定を書いた

| サイエンスチャンネルのRemedie設定を書いた - otsune's SnakeOil  を含むブックマーク はてなブックマーク - サイエンスチャンネルのRemedie設定を書いた - otsune's SnakeOil  サイエンスチャンネルのRemedie設定を書いた - otsune's SnakeOil  のブックマークコメント

汎用的なFilter-FindEnclosures/asx.plによって見られなくもなかったんだけど。

http://gyazo.com/b8d743a72106998fcc66c71f6691f4dc.png

という感じでファイル名しか表示されなくて何の動画だか分からないので。

CustomFeed-FindLinks/sc_smm_jst.yaml

# upgrades http://sc-smn.jst.go.jp/index.asp
# author: otsune
domain: sc-smn.jst.go.jp
handle: (?:/\d)?/(?:series|index)\.asp
follow_link: /\d/bangumi\.asp

Filter-FindEnclosures/sc_smm_jst.pl

# http://sc-smn.jst.go.jp/index.asp
# author: otsune
use Web::Scraper;
sub init {
    my $self = shift;
    $self->{domain} = "sc-smn.jst.go.jp";
    $self->{handle} = "/bangumi.asp";
}

sub needs_content { 1 }

sub find {
    my ($self, $args) = @_;

    my $res = scraper {
        process "//a[contains(\@href, '.asx')]", asx_url => '@href';
        process "//img[\@width='133' and \@height='100']", thumbnail => '@src';
    }->scrape($args->{content}, $args->{url});

    my $enclosure = Plagger::Enclosure->new;
    $enclosure->url($res->{asx_url});
    $enclosure->type("video/x-ms-asf");
    $enclosure->thumbnail({ url => $res->{thumbnail} });
    return $enclosure;
}

これによって

http://gyazo.com/b610ec67388801a76705097186c28181.png

こんな感じになって動画のタイトルが分かるようになる。

トラックバック - http://subtech.g.hatena.ne.jp/otsune/20081217