Plagger::Plugin::Publish::Excel ä½ã£ã¦ã¿ã
æ¨æ¥ã® Notify::YahooMessenger ã«ç¶ãã¦ãä»åº¦ã¯ Publish::Excel ãä½ã£ã¦ã¿ãã
1 Feed ã 1 ã·ã¼ã ã«ä¿åããã
Excel ã ã¨è¦ãç®ä»äºãã¦ãã£ã½ãã®ã§ãããããä¼ç¤¾ã«ãã人ã¯ãã使ã£ã¦ livedoor Reader or Bloglines â Excel ã§è¦ããããã¨æãããªãã¦æ¸ãããï¼ï¼
ãã¨ã¯ Filter::EntryFullText ã§åã£ã¦ãã¦ããããç°å¢ãç¡ãã¨ããã§èªãã ãã¨ãã
è·å ´ã§ããã使ããªãã¨æ²æ¨ããããã©ãéçºç¾å ´ã§å¤é¨ã®ã¡ã¼ã«ããèªããªãã¨ãããã¾ã ããã¿ãããªã®ã§ã
ç¾ç¶ã§ã¯åºåãã¦ãã ãã§ã¬ã¤ã¢ã¦ãã触ã£ã¦ãªãã®ã§ããªãèªã¿ã«ãããã©(ã©ããããã)ã
ããã«ã¾ã 追è¨ãåºæ¥ãªãã»ã»ã»
Spreadsheet::ParseExcel ã¨ã使ã£ããããã®ããªã
ã½ã¼ã¹ã¯ä»¥ä¸ã
package Plagger::Plugin::Publish::Excel; use strict; use warnings; use base qw(Plagger::Plugin); use Plagger::Util qw(strip_html); use Spreadsheet::WriteExcel; sub init { my $self = shift; $self->SUPER::init(@_); Plagger->context->error("filename is missing") unless exists $self->conf->{filename}; } sub register { my ($self, $context) = @_; $context->register_hook( $self, 'publish.init' => \&initialize, 'publish.feed' => \&feed, ); } sub initialize { my ($self, $context) = @_; my $workbook = Spreadsheet::WriteExcel->new($self->conf->{filename}); $self->{workbook} = $workbook; $self->{body_format} = $workbook->add_format(text_wrap => 1); } sub feed { my ($self, $context, $args) = @_; my $feed = $args->{feed}; my $worksheet = $self->{workbook}->add_worksheet(escape_sheet_name($feed->title)); my $row = 0; for my $entry ($feed->entries) { my $col = 0; $worksheet->write($row, $col++, $entry->date->format('Mail')); $worksheet->write($row, $col++, $entry->title); $worksheet->write($row, $col++, $entry->permalink); $worksheet->write($row, $col++, strip_html($entry->body), $self->{body_format}); $row++; } } sub escape_sheet_name { my $name = shift; $name =~ s![\[\]:*?/\\]! !g; $name; } 1; __END__ =head1 NAME Plagger::Plugin::Publish::Excel - Publish feeds as Excel workbook =head1 SYNOPSIS - module: Publish::Excel config: filename: /path/to/workbook.xls =head1 DESCRIPTION This plugin creates Excel workbook. =head1 AUTHOR Jiro Nishiguchi =head1 SEE ALSO L<Plagger>, L<Spreadsheet::WriteExcel> =cut
configã¯
- module: Publish::Excel config: filename: /path/to/workbook.xls
ãããªæãã§ã
å®éã¯ãããªæãã«ãªãã(Feed 㯠Plagger ã® timeline)