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])"

2006-04-28

Plagger::Plugin::SmartFeed.pmにlink属性を付ける

Plagger::Plugin::SmartFeed.pmにlink属性を付ける - otsune's SnakeOil  を含むブックマーク はてなブックマーク - Plagger::Plugin::SmartFeed.pmにlink属性を付ける - otsune's SnakeOil  Plagger::Plugin::SmartFeed.pmにlink属性を付ける - otsune's SnakeOil  のブックマークコメント

--- SmartFeed.pm.orig   Fri Apr 28 10:24:11 2006
+++ SmartFeed.pm        Fri Apr 28 10:26:49 2006
@@ -23,6 +23,7 @@
     $feed->type('smartfeed');
     $feed->id( $self->conf->{id} || ('smartfeed:' . $self->rule->id) );
     $feed->title( $self->conf->{title} || "Entries " . $self->rule->as_title );
+    $feed->link( $self->conf->{link} );
 
     $self->{feed} = $feed;
 }

んで

  - module: SmartFeed
    rule:
      expression: $args->{entry}->link =~ m|http://pcweb\.mycom\.co\.jp/series/\w+/\d+/|
    config:
      id: series
      title: 【連載】 (MYCOM PC WEB)
      link: http://pcweb.mycom.co.jp/top/series/

  - module: SmartFeed
    rule:
      expression: $args->{entry}->link =~ m|http://pcweb\.mycom\.co\.jp/column/osx/\d+/|
    config:
      id: osx
      title: 【コラム】 OS Xハッキング! (MYCOM PC WEB)
      link: http://pcweb.mycom.co.jp/column/osx/

  - module: SmartFeed
    rule:
      expression: $args->{entry}->link =~ m|http://pcweb\.mycom\.co\.jp/news/\d{4}/\d\d/\d\d/\d+\.html|
    config:
      id: news
      title: NEWS (MYCOM PC WEB)
      link: http://pcweb.mycom.co.jp/general/

こんな感じでlinkを指定すると

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://purl.org/atom/ns#">
  <title xmlns="http://purl.org/atom/ns#">NEWS (MYCOM PC WEB)</title>
  <link xmlns="http://purl.org/atom/ns#" type="text/html" rel="alternate" href="http://pcweb.mycom.co.jp/general/"/>

という風にAtomフィードのlink属性が付く。

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