#!/usr/bin/perl use strict; use warnings; use FindBin; use File::Spec; use lib File::Spec->catdir( $FindBin::Bin, 'lib' ); use Plagger; use Getopt::Long; use Config::Pit; use YAML; use File::Temp 'tempdir'; my $config = { global => { timezone => 'Asia/Tokyo', log => { level => 'debug', }, }, plugins => [ { module => 'Filter::Rule', rule => { module => 'Deduped', }, }, { module => 'Filter::FetchEnclosure', config => { dir => tempdir() }, }, ], }; my $sns = { frepa => { module => 'CustomFeed::Frepa', require => +{ livedoor_id => 'your livedoor id', password => 'your password', fetch_body => 1, show_icon => 1, feed_type => [ qw/FriendDiary/, ] } }, mixi => { module => 'CustomFeed::MixiScraper', require => +{ email => 'your email address', password => 'password', show_icon => 1, fetch_body => 1, feed_type => [qw/ Message RecentComment FriendDiary/], } } }; &main; exit; sub set($$) { my ( $module, $requires ) = @_; my $plugin = pit_get( "Plagger::Plugin::$module", require => $requires, ); unshift @{ $config->{plugins} }, +{ module => $module, config => $plugin, }; } sub main { set 'Publish::Gmail', +{ mailto => 'your mail address', mailfrom => 'your mail address', attach_enclosures => 1, mailroute => { via => 'smtp_tls', host => 'smtp.gmail.com:587', username => 'your email address', password => 'your password', } }; for my $site (@ARGV) { my $info = $sns->{$site} or die "unknown site: $site"; set $info->{module}, $info->{require}; } Plagger->bootstrap( config => $config ); } __END__ =head1 SYNOPSIS sns2gmail mixi sns2gmail mixi frepa =head1 DESCRIPTION mixi2gmail, frepa2gmail by plagger. =head1 INSTALL copy this file to top directory of plagger. =head1 AUTHOR Tokuhiro Matsuno =head1 LICENSE Same as Perl. =head1 SEE ALSO L, L