Changeset 1622

Show
Ignore:
Timestamp:
08/29/06 07:10:58
Author:
miyagawa
Message:

merge from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/hackathon-summary/plagger/Changes

    r1370 r1622  
    11The latest, HTML version of this document is always available at http://plagger.org/trac.cgi/wiki/PlaggerChangeLog 
     2 
     3== 0.7.9 (2006/08/24) == 
     4 
     5=== Core === 
     6 
     7 * Fixed BaseDirURI logic to allow empty dirname on Mac OSX (Yappo) 
     8 * Added tests to lots of plugins thanks to Testathoners 
     9 * Added Plagger::Walker util class to serialize feed data 
     10 * Merged from hackathon-mt branch. Added Plagger->set_context method 
     11 * Split bootstrap into new() and run() to be used in persisten programs 
     12 * Added $context->search() stub to get Plagger::Feed object from Search::* backends 
     13 * Added bin/plagger-search prototype CLI 
     14 * Added bin/plagger-atom-stream-consumer, very experimental AtomStream consumer 
     15 * Updated Plagger::Template->new() parameter 
     16 * assets_path: can now be localized per plugins using config:assets_path 
     17 * lots of fixes to tests so it can work on Windows 
     18 * decode config.yaml as UTF-8 automatically before run, unless you specify global:no_decode_utf8=1 
     19 * chimps-client: create lock dir to avoid double excecution 
     20 * Split feed parsing logic from Aggregator::Simple to Plagger::FeedParser so plugins can use.  
     21 * Added $ua->fetch_parse($feed) and $ua->find_parse($url) 
     22 * Fixed misusage of Term::Encoding (Yappo) 
     23 * Support entry level image in RSS 0.91 and 2.0 
     24 
     25 
     26=== New Plugins === 
     27 
     28 * Publish::JSON: Serialize feed to JSON (miyagawa) 
     29 * Publish::Serializer: Dump feed to various format using Data::Serializer (naoya, miyagawa) 
     30 * Notify::Audio: Play sound files when feed comes. Support playing enclosure files as well (miyagawa, youpy) 
     31 
     32=== Plugins Updates === 
     33 
     34 * Publish::Gmail: support APOP authentication in POP before SMTP 
     35 * Filter::Delicious: use Plagger::UA for caching. 
     36 * CustomFeed::Yahoo360JP: removed from the distro since no one is using it and it's broken 
     37 * Widget::Simple: Added lots of widgets (hsbt, jiro, drawnboy) 
     38 * Filter::EntryFullText: Fixed XHTML numeric entities issue when using XPath (spotted by otsune) 
     39 * Filter::2chRSSContent: Strip AD entry 
     40 * CustomFeed::YouTube: fix regexp to get page content (mizzy) 
     41 * Subscription::OPML: Fixed bug where containers are not correctly loaded because of array reference 
     42 * Subscriptoin::OPML: Ditch XML::OPML and rewrite OPML parser using XML::LibXML::SAX 
     43 * Filter::EntryFullText: extract_capture defaults to 'body' (suggested by otsune) 
     44 * Search::Rast: implemented searcher.search API (Yappo) 
     45 * Filter::TruePermalink: Fixed ref=rss YAML. Removed redirectors.yaml and instead introduced 'follow_redirect' config (default: 1) 
     46 * Notify::IRC: use color code scheme to colorize feed title and author (#movabletype) 
    247 
    348== 0.7.8 (2006/08/18) == 
  • branches/hackathon-summary/plagger/MANIFEST

    r1379 r1622  
    4949assets/plugins/Filter-EntryFullText/japan_zdnet_com.yaml 
    5050assets/plugins/Filter-EntryFullText/juno.yaml 
     51assets/plugins/Filter-EntryFullText/kojii_net.yaml 
    5152assets/plugins/Filter-EntryFullText/kyodo.yaml 
    5253assets/plugins/Filter-EntryFullText/kyoko_shimbun_news.yaml 
     
    118119assets/plugins/Filter-FindEnclosures/yourfilehost.pl 
    119120assets/plugins/Filter-FindEnclosures/youtube.pl 
    120 assets/plugins/Filter-StripRSSAd/feedburner 
    121 assets/plugins/Filter-StripRSSAd/google_adsense 
    122 assets/plugins/Filter-StripRSSAd/google_adsense2 
     121assets/plugins/Filter-StripRSSAd/feedburner.pat 
     122assets/plugins/Filter-StripRSSAd/google_adsense.pat 
     123assets/plugins/Filter-StripRSSAd/google_adsense2.pat 
    123124assets/plugins/Filter-StripRSSAd/namaan_ad.yaml 
    124 assets/plugins/Filter-StripRSSAd/pheedo 
    125 assets/plugins/Filter-StripRSSAd/pheedo_jp 
     125assets/plugins/Filter-StripRSSAd/pheedo.pat 
     126assets/plugins/Filter-StripRSSAd/pheedo_jp.pat 
    126127assets/plugins/Filter-StripRSSAd/pheedo_jp_ad_entry.yaml 
    127 assets/plugins/Filter-StripRSSAd/plaza_rakuten 
    128 assets/plugins/Filter-StripRSSAd/rssad_jp 
    129 assets/plugins/Filter-StripRSSAd/seesaa 
    130 assets/plugins/Filter-StripRSSAd/valueclick 
     128assets/plugins/Filter-StripRSSAd/plaza_rakuten.pat 
     129assets/plugins/Filter-StripRSSAd/rssad_jp.pat 
     130assets/plugins/Filter-StripRSSAd/seesaa.pat 
     131assets/plugins/Filter-StripRSSAd/valueclick.pat 
    131132assets/plugins/Filter-TruePermalink/2chrss.yaml 
    132133assets/plugins/Filter-TruePermalink/blogpeople.yaml 
     
    140141assets/plugins/Filter-TruePermalink/rd_yahoo.yaml 
    141142assets/plugins/Filter-TruePermalink/reddit.yaml 
    142 assets/plugins/Filter-TruePermalink/redirectors.yaml 
    143143assets/plugins/Filter-TruePermalink/refrss.yaml 
     144assets/plugins/Filter-TruePermalink/rssquery.yaml 
    144145assets/plugins/Filter-TruePermalink/tech_souken.yaml 
    145146assets/plugins/Filter-TruePermalink/tiyu_to.yaml 
     
    176177assets/plugins/Subscription-Planet/default.yaml 
    177178assets/plugins/Subscription-Planet/ja.yaml 
     179assets/plugins/Widget-Simple/1470.yaml 
    178180assets/plugins/Widget-Simple/bloglines.yaml 
     181assets/plugins/Widget-Simple/blogmap.yaml 
    179182assets/plugins/Widget-Simple/bulkfeeds.yaml 
    180183assets/plugins/Widget-Simple/delicious.yaml 
    181184assets/plugins/Widget-Simple/delicious_bookmark_users.yaml 
     185assets/plugins/Widget-Simple/digg.yaml 
     186assets/plugins/Widget-Simple/google_pagerank.yaml 
    182187assets/plugins/Widget-Simple/hatena_bookmark.yaml 
    183188assets/plugins/Widget-Simple/hatena_bookmark_users.yaml 
     
    185190assets/plugins/Widget-Simple/mm.yaml 
    186191assets/plugins/Widget-Simple/reddit.yaml 
     192assets/plugins/Widget-Simple/technorati.yaml 
    187193AUTHORS 
     194bin/plagger-atom-stream-consumer 
    188195bin/plagger-ircbot 
     196bin/plagger-search 
    189197bin/spotlight_comment.scpt 
    190198Changes 
     
    194202deps/CustomFeed-Mixi.yaml 
    195203deps/CustomFeed-SVNLog.yaml 
     204deps/Filter-2chNewsokuTitle.yaml 
     205deps/Filter-2chRSSContent.yaml 
     206deps/Filter-AtomLinkRelated.yaml 
    196207deps/Filter-Babelfish.yaml 
     208deps/Filter-BlogPet.yaml 
    197209deps/Filter-Delicious.yaml 
     210deps/Filter-DeliciousFeedTags.yaml 
    198211deps/Filter-Emoticon.yaml 
    199212deps/Filter-EntryFullText.yaml 
    200213deps/Filter-ExtractAuthorName.yaml 
     214deps/Filter-FeedFlareStripper.yaml 
    201215deps/Filter-GuessLanguage.yaml 
     216deps/Filter-HatenaBookmarkTag.yaml 
    202217deps/Filter-HatenaBookmarkUsersCount.yaml 
    203218deps/Filter-HatenaDiaryKeywordLink.yaml 
    204219deps/Filter-HatenaFormat.yaml 
     220deps/Filter-HatenaKeywordTag.yaml 
    205221deps/Filter-HTMLScrubber.yaml 
    206222deps/Filter-ImageInfo.yaml 
     223deps/Filter-Markdown.yaml 
    207224deps/Filter-Pipe.yaml 
     225deps/Filter-POPFile.yaml 
    208226deps/Filter-Profanity.yaml 
    209227deps/Filter-ResolveRelativeLink.yaml 
    210228deps/Filter-Romanize.yaml 
    211229deps/Filter-RSSLiberalDateTime.yaml 
     230deps/Filter-SpamAssassin.yaml 
     231deps/Filter-StripRSSAd.yaml 
     232deps/Filter-tDiaryComment.yaml 
    212233deps/Filter-Thumbnail.yaml 
    213234deps/Filter-TTP.yaml 
     235deps/Filter-URLBL.yaml 
     236deps/Notify-Audio-iTunesWin32.yaml 
     237deps/Notify-Audio-MSWin32.yaml 
     238deps/Notify-Audio.yaml 
    214239deps/Notify-Balloon.yaml 
    215240deps/Notify-Beep.yaml 
     
    220245deps/Notify-UpdatePing.yaml 
    221246deps/Publish-2chdat.yaml 
     247deps/Publish-CHTML.yaml 
    222248deps/Publish-CSV.yaml 
    223249deps/Publish-Delicious.yaml 
     
    227253deps/Publish-IMAP.yaml 
    228254deps/Publish-JavaScript.yaml 
     255deps/Publish-JSON.yaml 
    229256deps/Publish-Maildir.yaml 
    230257deps/Publish-MT.yaml 
     
    233260deps/Publish-Planet.yaml 
    234261deps/Publish-PowerPoint.yaml 
     262deps/Publish-Serializer.yaml 
    235263deps/Publish-Speech-MacOSX.yaml 
    236264deps/Publish-Speech-Win32.yaml 
     
    243271deps/Subscription-Bloglines.yaml 
    244272deps/Subscription-Bookmarks-InternetExplorer.yaml 
     273deps/Subscription-Bookmarks-Mozilla.yaml 
    245274deps/Subscription-Bookmarks-Safari.yaml 
    246275deps/Subscription-DBI.yaml 
     
    248277deps/Subscription-HatenaRSS.yaml 
    249278deps/Subscription-LivedoorReader.yaml 
     279deps/Subscription-Odeo.yaml 
    250280deps/Subscription-OPML.yaml 
     281deps/Subscription-PingServer.yaml 
    251282deps/Subscription-PlanetINI.yaml 
     283deps/Subscription-XOXO.yaml 
     284deps/Subscription-XPath.yaml 
    252285deps/Widget-Simple.yaml 
    253286examples/atode.yaml 
     
    259292examples/planet.yaml 
    260293examples/podcast.yaml 
     294examples/rss2email.yaml 
    261295examples/search.yaml 
     296examples/weather-notify.yaml 
    262297examples/xoxo-planet.yaml 
    263298examples/xoxo2opml.yaml 
     
    300335lib/Plagger/Entry.pm 
    301336lib/Plagger/Feed.pm 
     337lib/Plagger/FeedParser.pm 
    302338lib/Plagger/Mechanize.pm 
    303339lib/Plagger/Operator.pm 
     
    382418lib/Plagger/Plugin/Filter/TTP.pm 
    383419lib/Plagger/Plugin/Filter/URLBL.pm 
     420lib/Plagger/Plugin/Notify/Audio.pm 
     421lib/Plagger/Plugin/Notify/Audio/iTunesMac.pm 
     422lib/Plagger/Plugin/Notify/Audio/iTunesWin32.pm 
     423lib/Plagger/Plugin/Notify/Audio/MSWin32.pm 
    384424lib/Plagger/Plugin/Notify/Balloon.pm 
    385425lib/Plagger/Plugin/Notify/Beep.pm 
     
    409449lib/Plagger/Plugin/Publish/IMAP.pm 
    410450lib/Plagger/Plugin/Publish/JavaScript.pm 
     451lib/Plagger/Plugin/Publish/JSON.pm 
    411452lib/Plagger/Plugin/Publish/LivedoorClip.pm 
    412453lib/Plagger/Plugin/Publish/Maildir.pm 
     
    422463lib/Plagger/Plugin/Publish/PowerPoint.pm 
    423464lib/Plagger/Plugin/Publish/PSP.pm 
     465lib/Plagger/Plugin/Publish/Serializer.pm 
    424466lib/Plagger/Plugin/Publish/Speech.pm 
    425467lib/Plagger/Plugin/Publish/Speech/MacOSX.pm 
     
    485527lib/Plagger/UserAgent.pm 
    486528lib/Plagger/Util.pm 
     529lib/Plagger/Walker.pm 
    487530Makefile.PL 
    488531MANIFEST                        This list of files 
     
    490533plagger 
    491534t/00_compile.t 
     535t/assets/plugins/Test-AssetsPath/assets_path.tt 
     536t/samples/assets_path.tt 
    492537t/samples/atom-category.xml 
     538t/samples/atom-related.xml 
    493539t/samples/atom10-example.xml 
    494540t/samples/babelfish.xml 
     541t/samples/config.ini 
    495542t/samples/delicious.xml 
     543t/samples/feed.xml 
     544t/samples/feeds.txt 
    496545t/samples/googlevideo.xml 
    497546t/samples/guess-language/english.xml 
     
    507556t/samples/included.yaml 
    508557t/samples/monkey.rss 
     558t/samples/mozilla-bookmarks.html 
    509559t/samples/nasty.xml 
    510560t/samples/non-http-link.xml 
     561t/samples/opml-nested.xml 
     562t/samples/opml.xml 
    511563t/samples/photocast.rss 
    512564t/samples/rss-20.xml 
    513565t/samples/rss-full.xml 
     566t/samples/rss2-image.xml 
    514567t/samples/rss2sample.xml 
     568t/samples/safari_bookmarks.plist 
     569t/samples/sample.foaf 
     570t/samples/spamassassin/ham_rule.txt 
     571t/samples/spamassassin/spam_rule.txt 
    515572t/samples/tags-in-title.xml 
     573t/samples/tags-to-title.xml 
     574t/samples/tdiary.rdf 
     575t/samples/top10news.xml 
    516576t/samples/vox.xml 
     577t/samples/xoxo.html 
    517578t/TestPlagger.pm 
    518579tools/check-dependencies.pl 
  • branches/hackathon-summary/plagger/Makefile.PL

    r1544 r1622  
    2929requires('XML::Feed', 0.12); 
    3030requires('XML::LibXML'); 
    31 requires('XML::Atom', 0.19); 
     31requires('XML::Atom', 0.23); 
    3232requires('XML::RSS::LibXML', 0.20); 
    3333requires('Encode', 2.10); 
     
    4343features( 
    4444    'Better Encoding detection' => [ 
    45         -default => 1
     45        -default => 0
    4646        recommends('Encode::Detect'), 
    4747    ], 
     
    5757    'Liberal XML parsing' => [ 
    5858        -default => 1, 
    59         recommends('XML::Liberal', 0.13), 
     59        recommends('XML::Liberal', 0.14), 
    6060        recommends('XML::RSS::Liberal'), 
    6161    ], 
     
    9696auto_include; 
    9797auto_install; 
     98 
    9899install_script('plagger'); 
    99100install_script('bin/plagger-ircbot'); 
  • branches/hackathon-summary/plagger/assets/plugins/Filter-EntryFullText/slashcode.pl

    r757 r1622  
    11sub handle { 
    22    my($self, $args) = @_; 
    3     $args->{entry}->permalink =~ m!article\.pl\?sid=\d\d/\d\d/\d\d/\d+!; 
     3    $args->{entry}->permalink =~ m!article\.pl\?sid=\d\d/\d\d/\d\d/\d+|/~\w+/journal/\d+$!; 
    44} 
    55 
  • branches/hackathon-summary/plagger/assets/plugins/Filter-EntryFullText/zakzak.yaml

    r519 r1622  
    11# used with http://www.zakzak.co.jp/ or http://bulknews.net/rss/rdf.cgi?ZakZak 
    22author: youpy 
    3 custom_feed_handle: http://www\.zakzak\.co\.jp/$ 
     3custom_feed_handle: http://www\.zakzak\.co\.jp/ 
    44custom_feed_follow_link: (?:top|spo|gei)/\d+.*?\.html 
    55handle: http://www\.zakzak\.co\.jp/(?:top|spo|gei)/\d+ 
  • branches/hackathon-summary/plagger/assets/plugins/Filter-StripRSSAd/pheedo_jp_ad_entry.yaml

    r758 r1622  
    1 condition: $args->{entry}->link =~ m!^http://www\.pheedo\.jp/click\.phdo\?z=\w+&a=\w+&unq=\w+
     1condition: $args->{entry}->link =~ m!^http://www\.pheedo\.jp/click\.phdo\?(?:a=[\w\/]+|z=\w+&a=\w+&unq=\w+)! && $args->{entry}->title =~ m!^AD:
    22strip: 1 
    33 
  • branches/hackathon-summary/plagger/assets/plugins/Filter-TruePermalink/refrss.yaml

    r690 r1622  
    11author: youpy 
    2 rewrite: s/[\?&](?:ref|from|FM)=(?:atom|rss)// 
     2rewrite: s/[\?&;](?:ref|from|FM)=(?:atom|rss|rssall)([&;].*)?$/$1/ 
     3 
  • branches/hackathon-summary/plagger/assets/plugins/Notify-IRC/irc_notify.tt

    r1232 r1622  
    1 [%- SET title = feed.title || '(no-title)' -%] 
    2 [% feed.title_text %]: [% entry.title_text %] - [% entry.link %][% IF entry.author %] by [% entry.author %][% END %] 
     1[% IF feed.title %][% feed.title_text %]: [% END %][% entry.title_text %][% IF entry.author %] (03[% entry.author %])[% END %] - 14[% entry.permalink %] 
  • branches/hackathon-summary/plagger/assets/plugins/Widget-Simple/google_pagerank.yaml

    r1380 r1622  
    22query: 
    33  q: $args->{feed}->link 
    4 content_dynamic: <img src="http://www.pagerankon.com/smerankcheck.php?site=[% feed.link %]&s=style7" border="0" alt="Google PageRank"
     4content_dynamic: <img src="http://www.pagerankon.com/smerankcheck.php?site=[% feed.link %]&s=style7" border="0" alt="Google PageRank" style="border:0;vertical-align:middle" /
  • branches/hackathon-summary/plagger/bin/plagger-search

    r1391 r1622  
    33use warnings; 
    44 
    5 use Encode
     5use Encode ()
    66use FindBin; 
    77use Getopt::Long; 
     
    1515 
    1616my $context = Plagger->new(config => $path); 
    17 my $query = Encode::decode_utf8($ARGV[0]); 
     17my $query = decode($ARGV[0]); 
    1818 
    1919my @feeds = $context->search($query); 
    2020 
    2121my $feed = $feeds[0]; 
    22 binmode STDOUT, ":utf8"; 
    23 print "Search for '$query': ", $feed->count, " entries found.\n\n"; 
     22binmode STDOUT, ":utf8" unless $context->conf->{log}->{encoding}; 
     23exit unless $feed; 
     24print "Search for '" . encode($query) . "': ", $feed->count , " entries found.\n\n"; 
    2425 
    2526for my $entry ($feed->entries) { 
    26     print $entry->title, $entry->author ? "(by " . $entry->author . ")" : '', "\n"; 
    27     print $entry->body; # summary 
     27    print encode($entry->title), $entry->author ? "(by " . encode($entry->author) . ")" : '', "\n"; 
     28    print encode($entry->body); # summary 
    2829    print $entry->permalink, "\n"; 
    2930} 
    3031 
     32sub decode { 
     33    my $str = shift; 
     34    if ($context->conf->{log}->{encoding}) { 
     35        $str = Encode::decode($context->conf->{log}->{encoding}, $str); 
     36    } else { 
     37        $str = Encode::decode_utf8($str); 
     38    } 
     39    return $str; 
     40} 
     41 
     42sub encode { 
     43    my $str = shift; 
     44    if ($context->conf->{log}->{encoding}) { 
     45        $str = Encode::decode_utf8($str) unless utf8::is_utf8($str); 
     46        $str = Encode::encode($context->conf->{log}->{encoding}, $str); 
     47    } 
     48    return $str; 
     49} 
  • branches/hackathon-summary/plagger/lib/Plagger.pm

    r1618 r1622  
    11package Plagger; 
    22use strict; 
    3 our $VERSION = '0.7.8'; 
     3our $VERSION = '0.7.9'; 
    44 
    55use 5.8.1; 
     
    9191    } 
    9292 
    93     open my $fh, $self->{config_path} or $self->error("$self->{config_path}: $!"); 
     93    open my $fh, '<', $self->{config_path} or $self->error("$self->{config_path}: $!"); 
    9494    my $data = join '', <$fh>; 
    9595    close $fh; 
     
    187187    my($self, $file) = @_; 
    188188 
    189     open my $fh, $file or die "$file: $!"; 
     189    open my $fh, '<', $file or die "$file: $!"; 
    190190    while (<$fh>) { 
    191191        /^package (Plagger::Plugin::.*?);/ and return $1; 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin.pm

    r1412 r1622  
    1313use File::Find::Rule (); 
    1414use File::Spec; 
     15use Scalar::Util qw(blessed); 
    1516 
    1617sub new { 
     
    149150    my($self, $rule, $callback) = @_; 
    150151 
    151     my $context = Plagger->context; 
    152  
    153     my $dir = $self->assets_dir; 
     152    unless (blessed($rule) && $rule->isa('File::Find::Rule')) { 
     153        $rule = File::Find::Rule->name($rule); 
     154    } 
    154155 
    155156    # $rule isa File::Find::Rule 
    156     for my $file ($rule->in($dir)) { 
    157         $callback->($file); 
     157    for my $file ($rule->in($self->assets_dir)) { 
     158        my $base = File::Basename::basename($file); 
     159        $callback->($file, $base); 
    158160    } 
    159161} 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm

    r1611 r1622  
    9999 
    100100    if ($remote->format =~ /^RSS/) { 
    101         $feed->image( $remote->{rss}->image
     101        $feed->image( \%{$remote->{rss}->image}
    102102            if $remote->{rss}->image; 
    103103    } elsif ($remote->format eq 'Atom') { 
     
    170170        } 
    171171 
     172        # entry image support 
     173        if ($remote->format =~ /^RSS / and my $img = $e->{entry}->{image}) { 
     174            $entry->icon(\%$img); 
     175        } 
     176 
    172177        # TODO: move MediaRSS, Hatena, iTunes and those specific parser to be subclassed 
    173178        $self->handle_media_rss($entry, $e); 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r1573 r1622  
    3737    my $context = Plagger->context; 
    3838 
    39     my $dir = $self->assets_dir; 
    40     my $dh = DirHandle->new($dir) or $context->error("$dir: $!"); 
    41     for my $file (grep -f $_->[0] && $_->[0] =~ /\.(?:pl|yaml)$/, 
    42                   map [ File::Spec->catfile($dir, $_), $_ ], sort $dh->read) { 
    43         $self->load_plugin(@$file); 
    44     } 
    45 
    46  
    47 sub load_plugin { 
    48     my($self, $file, $base) = @_; 
    49  
    50     Plagger->context->log(debug => "loading $file"); 
    51  
    52     my $load_method = $file =~ /\.pl$/ ? 'load_plugin_perl' : 'load_plugin_yaml'; 
    53     push @{ $self->{plugins} }, $self->$load_method($file, $base); 
     39    $self->load_assets('*.yaml', sub { $self->load_plugin_yaml(@_) }); 
     40    $self->load_assets('*.pl',   sub { $self->load_plugin_perl(@_) }); 
    5441} 
    5542 
     
    5744    my($self, $file, $base) = @_; 
    5845 
    59     open my $fh, $file or Plagger->context->error("$file: $!"); 
     46    Plagger->context->log(debug => "Load plugin $file"); 
     47 
     48    open my $fh, '<', $file or Plagger->context->error("$file: $!"); 
    6049    (my $pkg = $base) =~ s/\.pl$//; 
    6150    my $plugin_class = "Plagger::Plugin::Filter::EntryFullText::Site::$pkg"; 
     
    8069    Plagger->context->error($@) if $@; 
    8170 
    82     return $plugin_class->new; 
     71    push @{ $self->{plugins} }, $plugin_class->new; 
    8372} 
    8473 
    8574sub load_plugin_yaml { 
    8675    my($self, $file, $base) = @_; 
     76 
     77    Plagger->context->log(debug => "Load YAML $file"); 
    8778    my @data = YAML::LoadFile($file); 
    8879 
    89     return map { Plagger::Plugin::Filter::EntryFullText::YAML->new($_, $base) } 
    90         @data; 
     80    push @{ $self->{plugins} }, 
     81        map { Plagger::Plugin::Filter::EntryFullText::YAML->new($_, $base) } @data; 
    9182} 
    9283 
     
    253244        if (my @match = $args->{content} =~ /$self->{extract}/s) { 
    254245            my @capture = split /\s+/, $self->{extract_capture}; 
     246            @capture = ('body') unless @capture; 
    255247            @{$data}{@capture} = @match; 
    256248        } 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Filter/FindEnclosures.pm

    r1551 r1622  
    5353    my($self, $file, $base) = @_; 
    5454 
    55     open my $fh, $file or Plagger->context->error("$file: $!"); 
     55    open my $fh, '<', $file or Plagger->context->error("$file: $!"); 
    5656    (my $pkg = $base) =~ s/\.pl$//; 
    5757    my $plugin_class = "Plagger::Plugin::Filter::FindEnclosures::Site::$pkg"; 
     
    184184 
    185185    my $mime = $type ? MIME::Type->new(type => $type) : Plagger::Util::mime_type_of( URI->new($url) ); 
    186     $mime && $mime->mediaType =~ m!^(?:audio|video|image)$!
     186    Plagger::Util::mime_is_enclosure($mime)
    187187} 
    188188 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Filter/HEADEnclosureMetadata.pm

    r1505 r1622  
    7171    my($res, $header) = @_; 
    7272 
    73     my $value = $res->header($header) or return undef; 
     73    my $value = $res->header($header) or return undef; ## no critic 
    7474    $value =~ s/;.*?$//; 
    7575    $value; 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Filter/Rule.pm

    r444 r1622  
    2828 
    2929    if ($args->{feed}->count == 0) { 
    30         $context->log(debug => "Deleting " . $args->{feed}->url . " since it has 0 entries"); 
     30        $context->log(debug => "Deleting " . $args->{feed}->title . " since it has 0 entries"); 
    3131        $context->update->delete_feed($args->{feed}) 
    3232    } 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Filter/SpamAssassin.pm

    r1432 r1622  
    3232 
    3333    # create a pseudo mail header to skip some of the sa's default tests 
    34     my $status = $sa->check_message_text( 
    35         MIME::Lite->new( 
    36             From    => 'plagger@localhost', 
    37             To      => 'plagger@localhost', 
    38             Subject => encode('MIME-Header', $entry->title_text), 
    39             Data    => $entry->body_text, 
    40         )->as_string 
    41     ); 
     34 
     35    my $mail  = MIME::Lite->new( 
     36        From       => 'plagger@localhost', 
     37        To         => 'plagger@localhost', 
     38        Subject    => encode('MIME-Header', $entry->title_text), 
     39        'X-Mailer' => 'plagger', 
     40        Data       => $entry->body_text, 
     41    )->as_string; 
     42 
     43    my $status = $sa->check_message_text( $mail ); 
    4244 
    4345    if ($status->is_spam) { 
     
    6567      new: 
    6668        local_tests_only: 1 
    67         config_text: 
    68           - score NO_RELAYS       0.0 
    69           - score NO_RECEIVED     0.0 
     69        site_rules_filename: some_rule.cf 
    7070 
    7171=head1 CONFIG 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Filter/StripRSSAd.pm

    r1551 r1622  
    99    $self->SUPER::init(@_); 
    1010    Plagger->context->autoload_plugin({ module => 'Filter::BloglinesContentNormalize' }); 
    11     $self->load_patterns(); 
    12 } 
    1311 
    14 sub load_patterns { 
    15     my $self = shift; 
    16  
    17     my $dir = $self->assets_dir; 
    18     my $dh = DirHandle->new($dir) or Plagger->context->error("$dir: $!"); 
    19     for my $file (grep -f $_->[0] && $_->[1] =~ /^[\w\-\.]+$/, 
    20                   map [ File::Spec->catfile($dir, $_), $_ ], sort $dh->read) { 
    21         $self->load_pattern(@$file); 
    22     } 
    23 
    24  
    25 sub load_pattern { 
    26     my($self, $file, $base) = @_; 
    27  
    28     Plagger->context->log(debug => "loading $file"); 
    29  
    30     if ($file =~ /\.yaml$/) { 
    31         $self->load_yaml($file, $base); 
    32     } else { 
    33         $self->load_regexp($file, $base); 
    34     } 
     12    $self->load_assets('*.yaml', sub { $self->load_yaml(@_) }); 
     13    $self->load_assets('*.pat',  sub { $self->load_regexp(@_)}); 
    3514} 
    3615 
    3716sub load_regexp { 
    3817    my($self, $file, $base) = @_; 
     18    Plagger->context->log(debug => "Load regexp $file"); 
    3919 
    40     open my $fh, $file or Plagger->context->error("$file: $!"); 
     20    open my $fh, '<', $file or Plagger->context->error("$file: $!"); 
    4121    my $re = join '', <$fh>; 
    4222    chomp($re); 
     
    4727sub load_yaml { 
    4828    my($self, $file, $base) = @_; 
     29    Plagger->context->log(debug => "Load YAML $file"); 
    4930 
    5031    my $pattern = eval { YAML::LoadFile($file) } 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Filter/TruePermalink.pm

    r933 r1622  
    1212    my $self = shift; 
    1313    $self->SUPER::init(@_); 
     14    $self->conf->{follow_redirect} = 1 unless exists $self->conf->{follow_redirect}; 
    1415    $self->load_plugins; 
    1516} 
     
    1819    my $self = shift; 
    1920 
    20     my $dir = $self->assets_dir; 
    21     my $dh = DirHandle->new($dir) or Plagger->context->error("$dir: $!"); 
    22     for my $file (grep -f $_->[0] && $_->[1] =~ /\.yaml$/, 
    23                   map [ File::Spec->catfile($dir, $_), $_ ], sort $dh->read) { 
    24         $self->load_plugin(@$file); 
    25     } 
    26 
    27  
    28 sub load_plugin { 
    29     my($self, $file, $base) = @_; 
    30  
    31     Plagger->context->log(debug => "loading $file"); 
    32     my $data = YAML::LoadFile($file); 
    33     if (ref($data) eq 'ARRAY') { 
    34         push @{$self->{redirectors}}, { follow_link => "^(?:" . join("|", @$data) . ")" }; 
    35     } else { 
    36         push @{$self->{plugins}}, $data; 
    37     } 
     21    $self->load_assets( 
     22        '*.yaml', 
     23        sub { 
     24            my $file = shift; 
     25            Plagger->context->log(debug => "loading $file"); 
     26            my $data = YAML::LoadFile($file); 
     27            if (ref($data) eq 'ARRAY') { 
     28                # redirectors.yaml ... make it backward compatible to ignore 
     29            } else { 
     30                push @{$self->{plugins}}, $data; 
     31            } 
     32        }, 
     33    ); 
    3834} 
    3935 
     
    9995    } 
    10096 
    101     unless ($count) { 
    102         for my $red (@{ $self->{redirectors} }) { 
    103             next unless $red->{follow_link}; 
    104             if ($link =~ /$red->{follow_link}/i) { 
    105                 my $url = $self->follow_redirect($link); 
    106                 if ($url && $url ne $link) { 
    107                     $count++; 
    108                     $rewritten = $url; 
    109                     last; 
    110                 } 
    111             } 
     97    # No match to known sites. Try redirect by issuing GET 
     98    if (!$count && $self->conf->{follow_redirect}) { 
     99        my $url = $self->follow_redirect($link); 
     100        if ($url && $url ne $link) { 
     101            $count++; 
     102            $rewritten = $url; 
    112103        } 
    113104    } 
     
    127118        "redirector:$link", 
    128119        sub { 
     120            Plagger->context->log(debug => "Issuing GET to $link to follow redirects"); 
    129121            my $ua  = Plagger::UserAgent->new; 
    130             my $res = $ua->simple_request( HTTP::Request->new(GET => $link) ); 
     122 
     123            # don't care about content body ... immediately die 
     124            my $res = $ua->simple_request( HTTP::Request->new(GET => $link), sub { die } ); 
    131125            if ($res->is_redirect) { 
    132126                return $res->header('Location'); 
    133127            } 
    134             return
     128            return ''
    135129        }, 
    136130        '1 day', 
    137131    ); 
    138132 
    139     Plagger->context->log(debug => "Resolving redirection of $link: $url") if $url; 
     133    Plagger->context->log(debug => "Resolved redirection of $link => $url") if $url; 
    140134 
    141135    return $url; 
     
    165159tries to rewrite url of them. 
    166160 
     161=head1 CONFIG 
     162 
     163=over 4 
     164 
     165=item follow_redirect 
     166 
     167If set to 1, this plugin issues GET request to entry permalinks to see 
     168if the server returns 301 or 302 redirect to other URL. Defaults to 1. 
     169 
     170=back 
     171 
    167172=head1 PATTERN FILES 
    168173 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Publish/CHTML.pm

    r1454 r1622  
    121121    my $earlier; 
    122122    my $file = "$path/earlier"; 
    123     if (open my $in, $file) { 
     123    if (open my $in, '<', $file) { 
    124124        $earlier = <$in>; 
    125125        close $in; 
    126126    } 
    127     open my $out, ">$file" or $self->context->error("$file: $!"); 
     127    open my $out, ">", $file or $self->context->error("$file: $!"); 
    128128    print $out $self->id; 
    129129    close $out; 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Publish/Feed.pm

    r1621 r1622  
    6262        my $entry = XML::Feed::Entry->new($feed_format); 
    6363        $entry->title($e->title); 
    64         $entry->link($e->link); 
     64        $entry->link($e->permalink); 
    6565        $entry->summary($e->body_text) if defined $e->body; 
    6666 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Publish/OutlineText.pm

    r801 r1622  
    3535 
    3636        foreach my $entry (@{ $feed->entries }) { 
    37             $out .= '..' . $entry->title . "\n"; 
     37            $out .= '..' . ($entry->title || '') . "\n"; 
    3838 
    3939            my $body = $entry->body_text; 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Publish/Pipe.pm

    r246 r1622  
    1515sub feed { 
    1616    my($self, $context, $args) = @_; 
    17      
    18     open my $out, "|" . $self->conf->{command} or $context->error("Can't open pipe: $!"); 
     17 
     18    open my $out, "|" . $self->conf->{command} or $context->error("Can't open pipe: $!"); ## no critic 
    1919    $context->log(info => "Publishing to " . $self->conf->{command}); 
    2020    for my $entry ($args->{feed}->entries) { 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Search/Rast.pm

    r131 r1622  
    33use base qw( Plagger::Plugin ); 
    44 
    5 use Encode
     5use Encode ()
    66use POSIX; 
    77use Rast; 
     
    1111    $context->register_hook( 
    1212        $self, 
    13         'publish.feed' => \&feed, 
     13        'publish.feed'     => \&feed, 
    1414        'publish.finalize' => \&finalize, 
     15        'searcher.search'  => \&search, 
    1516    ); 
    1617} 
     
    9596                        $feed->link,  
    9697                        $entry->permalink,  
    97                         $self->convert($entry->title) || '',  
    98                         $self->convert($entry->author) || '',  
     98                        $self->encode($entry->title) || '',  
     99                        $self->encode($entry->author) || '',  
    99100                        POSIX::strftime('%Y-%m-%dT%H:%M:%S', localtime($time)), 
    100                         $self->convert(join(' ', @{ $entry->tags })) 
     101                        $self->encode(join(' ', @{ $entry->tags })) 
    101102                        ]; 
    102103 
    103         my $text = $self->convert($entry->text); 
     104        my $text = $self->encode($entry->text); 
    104105        unless ($result->hit_count) { 
    105106            my $id = $rast->register($text, $options); 
     
    113114} 
    114115 
    115 sub convert
     116sub encode
    116117    my ($self, $str) = @_; 
    117118    utf8::decode($str) unless utf8::is_utf8($str); 
    118     return encode($self->{encode}, $str); 
     119    return Encode::encode($self->{encode}, $str); 
     120
     121 
     122sub decode { 
     123    my ($self, $str) = @_; 
     124    return Encode::decode($self->{encode}, $str); 
    119125} 
    120126 
     
    123129    return unless $self->{rast}; 
    124130    $self->{rast}->close; 
     131} 
     132 
     133sub search { 
     134    my($self, $context, $args) = @_; 
     135 
     136    my $result = $self->{rast}->search($self->encode($args->{query}), { 
     137        need_summary => 1, 
     138        properties => [qw/feedlink permalink title author/], 
     139    }); 
     140 
     141    my $feed = Plagger::Feed->new; 
     142    $feed->type('search:Rast'); 
     143    $feed->title("Search: $args->{query}"); 
     144 
     145    while (my $row = $result->fetch) { 
     146        my $entry = Plagger::Entry->new; 
     147 
     148        $entry->link($row->{properties}->[0]); 
     149        $entry->permalink($row->{properties}->[1]); 
     150        $entry->title($self->decode($row->{properties}->[2]));  
     151        $entry->author($self->decode($row->{properties}->[3])) ; 
     152        $entry->body($self->decode($row->{summary})); 
     153        $feed->add_entry($entry); 
     154    } 
     155 
     156    return $feed; 
    125157} 
    126158 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Subscription/Bookmarks/InternetExplorer.pm

    r994 r1622  
    11package Plagger::Plugin::Subscription::Bookmarks::InternetExplorer; 
     2use strict; 
    23use base qw( Plagger::Plugin::Subscription::Bookmarks ); 
    34 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Subscription/Bookmarks/Mozilla.pm

    r998 r1622  
    11package Plagger::Plugin::Subscription::Bookmarks::Mozilla; 
     2use strict; 
    23use base qw( Plagger::Plugin::Subscription::XPath ); 
    34 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Subscription/Bookmarks/Safari.pm

    r1488 r1622  
    11package Plagger::Plugin::Subscription::Bookmarks::Safari; 
     2use strict; 
    23use base qw( Plagger::Plugin::Subscription::Bookmarks ); 
    34 
  • branches/hackathon-summary/plagger/lib/Plagger/Plugin/Widget/Simple.pm

    r1525 r1622  
    2222        my $found; 
    2323        $self->load_assets( 
    24             File::Find::Rule->name("$name.yaml")
     24            "$name.yaml"
    2525            sub { 
    2626                my $data = YAML::LoadFile(shift); 
  • branches/hackathon-summary/plagger/lib/Plagger/Rule/Always.pm

    r78 r1622  
    11package Plagger::Rule::Always; 
     2use strict; 
    23use base qw( Plagger::Rule ); 
    34 
  • branches/hackathon-summary/plagger/lib/Plagger/Util.pm

    r1620 r1622  
    22use strict; 
    33our @ISA = qw(Exporter); 
    4 our @EXPORT_OK = qw( strip_html dumbnail decode_content extract_title load_uri mime_type_of filename_for ); 
     4our @EXPORT_OK = qw( strip_html dumbnail decode_content extract_title load_uri mime_type_of filename_for mime_is_enclosure ); 
    55 
    66use Encode (); 
     
    154154our $mimetypes = MIME::Types->new; 
    155155$mimetypes->addType( MIME::Type->new(type => 'video/x-flv', extensions => [ 'flv' ]) ); 
    156 $mimetypes->addType( MIME::Type->new(type => 'audio/aac', extensions => [ 'm4a', '.aac' ]) ); 
     156$mimetypes->addType( MIME::Type->new(type => 'audio/aac', extensions => [ 'm4a', 'aac' ]) ); 
     157$mimetypes->addType( MIME::Type->new(type => 'video/mp4', extensions => [ 'mp4', 'm4v' ]) ); 
    157158 
    158159sub mime_type_of { 
     
    160161 
    161162    if (UNIVERSAL::isa($ext, 'URI')) { 
    162         $ext = ( $ext->path =~ /\.(\w+)/ )[0]; 
     163        $ext = ( $ext->path =~ /\.(\w+)$/ )[0]; 
    163164    } 
    164165 
    165166    return unless $ext; 
    166167    return $mimetypes->mimeTypeOf($ext); 
     168} 
     169 
     170sub mime_is_enclosure { 
     171    my $mime = shift; 
     172    return unless $mime; 
     173    $mime->mediaType =~ m!^(?:audio|video|image)$! || $mime->type eq 'application/ogg'; 
    167174} 
    168175 
  • branches/hackathon-summary/plagger/lib/Plagger/Walker.pm

    r1479 r1622  
    1616    my($self, $stuff) = @_; 
    1717    $self = $self->new( apply_keys => 1 ) unless ref $self; 
    18     $self->apply(sub { $_[0] = Encode::decode_utf8($_[0]) unless utf8::is_utf8($_[0]) })->($stuff); 
     18    $self->apply(sub { utf8::decode($_[0]) unless utf8::is_utf8($_[0]) })->($stuff); 
    1919} 
    2020 
    21 sub apply($&;@) { 
     21sub apply($&;@) { ## no critic 
    2222    my $self = shift; 
    2323    my $code = shift; 
  • branches/hackathon-summary/plagger/t/core/feed-parser-discover.t

    r1492 r1622  
    2121=== Straight Feed URL 
    2222--- input 
    23 http://d.hatena.ne.jp/miyagawa/rs
     23http://feeds.feedburner.com/bulknew
    2424--- expected 
    25 http://d.hatena.ne.jp/miyagawa/rs
     25http://feeds.feedburner.com/bulknew
    2626 
    27 === Straight Feed URL RSS2 
     27=== Straight Feed TypePad 
    2828--- input 
    29 http://d.hatena.ne.jp/miyagawa/rss2 
     29http://bulknews.typepad.com/blog/atom.xml 
    3030--- expected 
    31 http://d.hatena.ne.jp/miyagawa/rss2 
     31http://bulknews.typepad.com/blog/atom.xml 
    3232 
    3333=== Auto-Disocvery 
    3434--- input 
    35 http://d.hatena.ne.jp/miyagawa/ 
     35http://subtech.g.hatena.ne.jp/miyagawa/ 
    3636--- expected 
    37 http://d.hatena.ne.jp/miyagawa/rss 
     37http://subtech.g.hatena.ne.jp/miyagawa/rss2 
    3838 
    3939=== No RSS Auto-Discovery 
  • branches/hackathon-summary/plagger/t/core/feed-parser.t

    r1492 r1622  
    1919=== Straight Feed URL 
    2020--- input 
    21 http://d.hatena.ne.jp/miyagawa/rss 
     21http://subtech.g.hatena.ne.jp/miyagawa/rss 
    2222--- expected 
    23 miyagawaの日記 
    24  
    25 === Straight Feed URL RSS2 
    26 --- input 
    27 http://d.hatena.ne.jp/miyagawa/rss2 
    28 --- expected 
    29 miyagawaの日記 
     23Bulknews::Subtech 
    3024 
    3125=== Auto-Discovery 
    3226--- input 
    33 http://d.hatena.ne.jp/miyagawa
     27http://blog.bulknews.net/mt
    3428--- expected 
    35 miyagawaの日記 
     29blog.bulknews.net 
  • branches/hackathon-summary/plagger/t/plugins/Filter-Emoticon/google_talk.t

    r1508 r1622  
    2020  - module: Filter::Emoticon 
    2121    config: 
    22       driver: MSN 
     22      driver: GoogleTalk 
    2323    option: 
    2424      strict: 1 
     
    2626--- expected 
    2727ok 1, $block->name; 
    28 is $context->update->feeds->[0]->entries->[0]->body, 'Yet Another Perl Hacker <img src="http://example.com/emo/regular_smile.gif" />' 
     28is $context->update->feeds->[0]->entries->[0]->body, 'Yet Another Perl Hacker <img src="http://mail.google.com/mail/help/images/screenshots/chat/wink_nose.gif" />' 
     29 
  • branches/hackathon-summary/plagger/t/plugins/Filter-Emoticon/msn.t

    r1508 r1622  
    33 
    44test_plugin_deps; 
    5 test_requires('Text::Emoticon::MSN'); 
     5test_requires('Text::Emoticon::MSN', 0.03); 
    66plan 'no_plan'; 
    77run_eval_expected; 
  • branches/hackathon-summary/plagger/t/plugins/Filter-EntryFullText/kojiinet.t

    r1383 r1622  
    2424  - module: Filter::EntryFullText 
    2525--- expected 
     26ok $context->update->feeds->[0]->entries->[0]->body; 
    2627unlike $context->update->feeds->[0]->entries->[0]->body, qr/&#\d+;/; 
    2728 
  • branches/hackathon-summary/plagger/t/plugins/Filter-HTMLScrubber/base.t

    r1571 r1622  
    44test_plugin_deps; 
    55plan 'no_plan'; 
    6 run_eval_expected_with_capture
     6run_eval_expected
    77 
    88__END__ 
     
    1111--- input config 
    1212plugins: 
     13  - module: CustomFeed::Debug 
     14    config: 
     15      title: foo 
     16      link: 'http://www.example.net/' 
     17      entry: 
     18        - title: bar 
     19          link: 'http://www.example.net/1' 
     20          body: | 
     21            <script type="text/javascript"> 
     22            function pla() { 
     23                alert("Plagger is a pluggable aggregator"); 
     24            } 
     25            </script> 
     26            <p> 
     27                <a href="#" onclick="pla()">Plagger is a pluggable aggregator</a> 
     28            </p> 
    1329  - module: Filter::HTMLScrubber 
    1430--- expected 
    1531ok 1, $block->name; 
     32unlike $context->update->feeds->[0]->entries->[0]->body, qr!</?script .*?>!sm; 
    1633 
    17 === Simple test 
    18 --- input config 
    19 plugins: 
    20   - module: CustomFeed::Debug 
    21     config: 
    22       title: Foo Bar 
    23       entry: 
    24         - title: Nasty 
    25           body: Foo <style>bar</style> 
    26   - module: Filter::HTMLScrubber 
    27 --- expected 
    28 unlike $context->update->feeds->[0]->entries->[0]->body, qr!<style>bar</style>! 
    29  
    30 === Don't scrub non-HTML 
    31 --- input config 
    32 global: 
    33   log: 
    34     level: debug 
    35 plugins: 
    36   - module: CustomFeed::Debug 
    37     config: 
    38       title: Foo Bar 
    39       entry: 
    40         - title: Nasty 
    41           body: This is not HTML. 
    42   - module: Filter::HTMLScrubber 
    43 --- expected 
    44 unlike $warning, qr/Scrubbing/; 
    45  
    46  
  • branches/hackathon-summary/plagger/t/plugins/Filter-HatenaDiaryKeywordLink/base.t

    r1444 r1622  
    22use t::TestPlagger; 
    33 
    4 test_requires_network 'b.hatena.ne.jp:80'; 
     4plan skip_all => 'The site it tries to test is unreliable.' unless $ENV{TEST_UNRELIABLE_NETWORK}; 
     5test_requires_network 'd.hatena.ne.jp:80'; 
     6test_plugin_deps; 
    57 
    68plan 'no_plan'; 
  • branches/hackathon-summary/plagger/t/plugins/Filter-TruePermalink/oreilly.t

    r1301 r1622  
    11use t::TestPlagger; 
    22 
     3test_requires_network; 
    34plan 'no_plan'; 
    45run_eval_expected; 
     
    910--- input config 
    1011plugins: 
    11   - module: Subscription::Confi
     12  - module: CustomFeed::Debu
    1213    config: 
    13       feed: 
    14         - http://www.makezine.com/ 
     14      title: Make 
     15      link: http://www.makezine.com/ 
     16      entry: 
     17        - title: Foo 
     18          link: http://www.makezine.com/blog/archive/2006/08/usb_bbq.html?CMP=OTC-0D6B48984890 
    1519  - module: Filter::TruePermalink 
    1620--- expected 
  • branches/hackathon-summary/plagger/t/plugins/Search-Estraier/search.t

    r1391 r1622  
    1515 
    1616my $ver = `estconfig --version`; 
    17 if ($ver =~ /^1\.3/ && $^O eq 'freebsd') { 
    18     plan skip_all => "This test doesn't work with 1.3.x on FreeBSD: $ver"; 
     17if ($ver =~ /^1\.3\.[0-8]/ && $^O eq 'freebsd') { 
     18    plan skip_all => "Estraier 1.3.x doesn't work on FreeBSD until 1.3.9: $ver"; 
    1919} 
    2020 
  • branches/hackathon-summary/plagger/t/plugins/Subscription-2chThreadlist/base.t

    r1496 r1622  
    22use t::TestPlagger; 
    33 
     4plan skip_all => 'The site it tries to test is unreliable.' unless $ENV{TEST_UNRELIABLE_NETWORK}; 
    45test_requires_network('rss.s2ch.net:80'); 
    56plan tests => 1; 
  • branches/hackathon-summary/plagger/t/regression/mime-type-dup.t

    r846 r1622  
    11use strict; 
    2 use Test::More tests => 3
     2use Test::More tests => 5
    33 
    44use Plagger::Util; 
     
    99is Plagger::Util::mime_type_of("flv"), "video/x-flv"; 
    1010is Plagger::Util::mime_type_of("m4a"), "audio/aac"; 
     11is Plagger::Util::mime_type_of("foo.mp4"), "video/mp4"; 
     12is Plagger::Util::mime_type_of("bar.m4v"), "video/mp4"; 
    1113 
    1214is $warning, undef; 
  • branches/hackathon-summary/plagger/tools/chimps-smoker.pl

    r1452 r1622  
    99our $lockdir = "$ENV{HOME}/.plagger-smoke.lock"; 
    1010mkdir $lockdir, 0777 or die "Other process is running!\n"; 
     11our $rmdir  = 1; 
    1112 
    1213our $repo = "http://svn.bulknews.net/repos/plagger"; 
     14our $trac = "http://plagger.org/trac"; 
    1315our $file = "$ENV{HOME}/.plagger-smoke.yml"; 
    1416 
     
    2022my $run; 
    2123while (++$config->{revision} <= $current) { 
    22     run_chimps($config->{revision}); 
     24    my $branch = get_branch($config->{revision}); 
     25    run_chimps($config->{revision}, $branch); 
    2326    $run++; 
    2427} 
     
    2730YAML::DumpFile($file, $config) if $run; 
    2831 
    29 rmdir $lockdir if -e $lockdir
     32END { rmdir $lockdir if $rmdir && -e $lockdir }
    3033 
    3134sub run_chimps { 
    32     my $revision = shift
     35    my($revision, $branch) = @_
    3336 
    3437    my $workdir  = tempdir(CLEANUP => 1); 
     
    4144    } 
    4245 
     46    warn "Testing r$revision on $branch\n"; 
     47 
    4348    delete $ENV{LANG}; # svn doesn't grok LANG=ja_JP.UTF-8 
    44     system("svn co -r $revision $repo/trunk/plagger $checkout"); 
     49    system("svn co -r $revision $repo/$branch/plagger $checkout"); 
    4550    chdir $checkout; 
    4651 
     
    6166    return; 
    6267} 
     68 
     69sub get_branch { 
     70    my $revision = shift; 
     71    my $diff = LWP::Simple::get("$trac/changeset/$revision?format=diff"); 
     72    $diff =~ m!^Index: (branches/[^/]+|trunk)/! and return $1; 
     73    return "trunk"; 
     74}