Changeset 1906

Show
Ignore:
Timestamp:
12/05/06 08:02:16
Author:
miyagawa
Message:

refactoring-email: merge from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/refactoring-email/plagger/AUTHORS

    r1734 r1906  
    3939Kentaro Kuribayashi 
    4040Koichi Taniguchi 
     41Nik Clayton 
  • branches/refactoring-email/plagger/Changes

    r1773 r1906  
    11The latest, HTML version of this document is always available at http://plagger.org/trac.cgi/wiki/PlaggerChangeLog 
     2 
     3== 0.7.16 (2006/11/26) == 
     4 
     5=== Core === 
     6 
     7 * Plagger::Date->parse_dwim now supports Japanese date format 
     8 * $plugin->load_assets ignore .svn directory by default 
     9 * update DateTime and DateTime::Locale dependencies 
     10 
     11=== New Plugins === 
     12 
     13 * Summary::Japanese: Summary generator using Lingua::JA::Summarize::Japanese::Extract (miyagawa, ko) 
     14 * Summary::AppleScript: Summary generator using MacOSX summary service (otsune) 
     15 * Filter::DegradeYoutube: degrade YouTube embed video HTML (tokuhirom) 
     16 
     17=== Plugins Updates === 
     18 
     19 * Filter::EntryFullText: Update patterns for Slashdot.jp, pmachine 
     20 * Filter::TruePermalink: added ?fr=rdf (otsune) 
     21 * CustomFeed::POP3: Made it more liberal to parse Date: header 
     22 * Filter::Babelfish: Fixed bug around Plagger::Text 
     23 * Filter::HatenaDiaryKeywordUnlink: Support annonymous diary (kentaro) 
     24 * CustomFeed::Mixi: reworked regular expression to work with site updates. Now image links are added to enlcousres 
     25 * CustomFeed::Debug: Allow "entries" key. Auto set type on enclosures if not set. 
     26 * Filter::EntryFullText: support Japanese date format per Plagger::Date updates 
     27 * Subscription::Bloglines: 'dont_use_notifier_api' to work around Notifer API bug 
     28 * Fitler::2chRSSContent: work around with s2ch.net URL changes 
     29 * Notify::IRC: Update defaulte templates colors (typester) 
     30 * CustomFeed::Mixi: bumped WWW::Mixi deps 
     31 * CustomFeed::MixiDiarySearch: HTML updates 
     32 * Filter::EntryFullText: XPath support now works with non-Node element (nikc) 
     33 * Publish::Feed: fixed bugs that it emits empty category tags and nobody author elemen 
     34 
     35== 0.7.15 (2006/11/01) == 
     36 
     37=== Core === 
     38 
     39 * bump up Encode::Detect dependency so it's easier to install 
     40  
     41=== New Plugins === 
     42 
     43 * Summary::GetSen: Use GetSen web service to get summary 
     44 
     45=== Plugins Updates === 
     46 
     47 * CustomFeed::YouTube: Update queries unencoded in YAML (mizzy) 
     48 * Summary::Simple: Get the first sentence if it's plain text  
     49 * Filter::StripRSSAd: support pheedo variant ads, RSScache.com 
     50 * Publish::Gmail: now allows non-UTF8 encoding by setting 'encoding'  
     51 * CustomFeed::Mixi: Updated regular expression to keep up with the site updates 
     52 * Publish::Maildir: fixed enclosure bugs 
     53 * Filter::Markdown: fixed configuration pass bug 
     54 * Filter::GuessTimeZoneByDomain: bump up DateTime::TimeZone requirement 
     55 * Publish::Gmail: don't die if enclosure URL is not found and thus not saved in the local 
     56 * CustomFeed::Script: added SSL expire example code 
     57 * Subscriptoin::Planet: Update Google Blog search to use Japanese version 
     58 * Filter::EntryFullText: show debug message if YAML mandatory key is not found 
     59 * Publish::Feed: fixed a critical bug that the content is always b64 encoded 
    260 
    361== 0.7.14 (2006/10/17) == 
  • branches/refactoring-email/plagger/MANIFEST

    r1773 r1906  
    33assets/plugins/CustomFeed-Script/domain-expire.pl 
    44assets/plugins/CustomFeed-Script/jsports-football.pl 
     5assets/plugins/CustomFeed-Script/slims_calendar.pl 
     6assets/plugins/CustomFeed-Script/ssl-expire.pl 
    57assets/plugins/CustomFeed-Script/wowow-hv-51ch.pl 
    68assets/plugins/CustomFeed-Script/wowow-liga-espanola.pl 
     
    1517assets/plugins/Filter-EntryFullText/ascii24_com.yaml 
    1618assets/plugins/Filter-EntryFullText/atmarkit.yaml 
     19assets/plugins/Filter-EntryFullText/baltimoresun_com.yaml 
    1720assets/plugins/Filter-EntryFullText/barks.yaml 
    1821assets/plugins/Filter-EntryFullText/bbc.yaml 
     
    3942assets/plugins/Filter-EntryFullText/docs_info_apple_com.yaml 
    4043assets/plugins/Filter-EntryFullText/drecom.yaml 
     44assets/plugins/Filter-EntryFullText/dsp_co_jp.yaml 
    4145assets/plugins/Filter-EntryFullText/eweek.yaml 
    4246assets/plugins/Filter-EntryFullText/extremetech.yaml 
    4347assets/plugins/Filter-EntryFullText/forbes.yaml 
    4448assets/plugins/Filter-EntryFullText/ft.yaml 
     49assets/plugins/Filter-EntryFullText/gigazine_net.yaml 
    4550assets/plugins/Filter-EntryFullText/gyao_content.pl 
    4651assets/plugins/Filter-EntryFullText/hatena_diary.pl 
     
    7075assets/plugins/Filter-EntryFullText/matino-akari_com.yaml 
    7176assets/plugins/Filter-EntryFullText/memn0ck.yaml 
     77assets/plugins/Filter-EntryFullText/mt2.pl 
    7278assets/plugins/Filter-EntryFullText/mtv-music.yaml 
    7379assets/plugins/Filter-EntryFullText/mycom_journal.yaml 
    7480assets/plugins/Filter-EntryFullText/netkeiba.yaml 
     81assets/plugins/Filter-EntryFullText/news_3yen_com.yaml 
    7582assets/plugins/Filter-EntryFullText/news_com.yaml 
    7683assets/plugins/Filter-EntryFullText/news_livedoor_com.yaml 
    7784assets/plugins/Filter-EntryFullText/newsforge.yaml 
     85assets/plugins/Filter-EntryFullText/nifty_com_usuta.yaml 
    7886assets/plugins/Filter-EntryFullText/nikkansports.yaml 
    7987assets/plugins/Filter-EntryFullText/nikkei.yaml 
     
    144152assets/plugins/Filter-StripRSSAd/plaza_rakuten.pat 
    145153assets/plugins/Filter-StripRSSAd/rssad_jp.pat 
     154assets/plugins/Filter-StripRSSAd/rsscache.pat 
    146155assets/plugins/Filter-StripRSSAd/seesaa.pat 
    147156assets/plugins/Filter-StripRSSAd/valueclick.pat 
     
    229238deps/Filter-Babelfish.yaml 
    230239deps/Filter-BlogPet.yaml 
     240deps/Filter-DegradeYouTube.yaml 
    231241deps/Filter-Delicious.yaml 
    232242deps/Filter-DeliciousFeedTags.yaml 
     
    322332deps/Subscription-XOXO.yaml 
    323333deps/Subscription-XPath.yaml 
     334deps/Summary-AppleScript.yaml 
    324335deps/Summary-Auto.yaml 
    325336deps/Summary-English.yaml 
     337deps/Summary-GetSen.yaml 
    326338deps/Summary-HatenaBookmark.yaml 
     339deps/Summary-Japanese.yaml 
    327340deps/Summary-Simple.yaml 
    328341deps/Summary-TextOriginal.yaml 
     
    421434lib/Plagger/Plugin/Filter/BulkfeedsTerms.pm 
    422435lib/Plagger/Plugin/Filter/CompositeFeed.pm 
     436lib/Plagger/Plugin/Filter/DegradeYouTube.pm 
    423437lib/Plagger/Plugin/Filter/Delicious.pm 
    424438lib/Plagger/Plugin/Filter/DeliciousFeedTags.pm 
     
    563577lib/Plagger/Plugin/Subscription/XOXO.pm 
    564578lib/Plagger/Plugin/Subscription/XPath.pm 
     579lib/Plagger/Plugin/Summary/AppleScript.pm 
    565580lib/Plagger/Plugin/Summary/Auto.pm 
    566581lib/Plagger/Plugin/Summary/English.pm 
     582lib/Plagger/Plugin/Summary/GetSen.pm 
    567583lib/Plagger/Plugin/Summary/HatenaBookmark.pm 
     584lib/Plagger/Plugin/Summary/Japanese.pm 
    568585lib/Plagger/Plugin/Summary/Simple.pm 
    569586lib/Plagger/Plugin/Summary/TextOriginal.pm 
  • branches/refactoring-email/plagger/Makefile.PL

    r1741 r1906  
    1212requires('YAML' => 0.39); 
    1313requires('Text::Tags'); 
    14 requires('DateTime' => 0.29); 
     14requires('DateTime' => 0.35); 
     15requires('DateTime::TimeZone' => 0.56); 
     16requires('DateTime::Locale' => 0.32); 
    1517requires('DateTime::Format::Mail'); 
    1618requires('DateTime::Format::W3CDTF'); 
     
    4547    'Better Encoding detection' => [ 
    4648        -default => 0, 
    47         recommends('Encode::Detect'), 
     49        recommends('Encode::Detect', 1.0), 
    4850    ], 
    4951    'POD Testing' => [ 
     
    6971        recommends('HTML::TreeBuilder'), 
    7072        recommends('HTML::FormatText'), 
     73    ], 
     74    'Parse Japanese datetime format' => [ 
     75        -default => 0, 
     76        recommends('DateTime::Format::Japanese'), 
    7177    ], 
    7278); 
  • branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/pmachine.pl

    r966 r1906  
    22sub handle { 
    33    my($self, $args) = @_; 
    4     $args->{content} =~ m!Powered by <a href="?http://www\.pmachine\.com/!si
     4    $args->{content} =~ m!<a href="http://www\.pmachine\.com/">Powered by ExpressionEngine</a>!s
    55} 
    66 
    77sub extract { 
    88    my($self, $args) = @_; 
    9     if ($args->{content} =~ m!<h2 class="title">(?:.*?)</h2>(?:</a>)?(.*?)<\!--\n<rdf:RDF!s){ 
     9    if ($args->{content} =~ m!<div (?:id="content"|class="(?:entryBody|blogbody)")>(.*?)<div class="posted">!s){ 
    1010        my $body = $1; 
    1111        return "<div>$body</div>"; 
  • branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/slashdot_jp.yaml

    r515 r1906  
    22author: Tatsuhiko Miyagawa 
    33handle: http://slashdot.jp/.*?article\.pl\? 
    4 extract: (<div class="introtext">.*?</div>).*?(<div class="bodytext">.*?</div>)? 
     4extract: (<div class="intro">.*?</div>).*?(<div class="bodytext">.*?</div>)? 
    55extract_capture: body more 
    66extract_after_hook: $data->{body} .= $data->{more} if $data->{more} 
  • branches/refactoring-email/plagger/assets/plugins/Filter-TruePermalink/2chrss.yaml

    r612 r1906  
    22match: http://rss\.s2ch\.net/ 
    33rewrite: | 
    4   s!rss\.s2ch\.net/test/\-/(.*?\.2ch\.net/)!$1test/read.cgi/!; 
     4  s!rss\.s2ch\.net/test(?:\.cgi)?/\-/(.*?\.2ch\.net/)!$1test/read.cgi/!; 
  • branches/refactoring-email/plagger/assets/plugins/Filter-TruePermalink/refrss.yaml

    r1632 r1906  
    11author: youpy 
    2 rewrite: s/[\?&;](?:ref|from|FM)=(?:atom|rss|rssall)([&;].*)?$/defined($1) ? $1 : ''/e 
     2rewrite: s/[\?&;](?:fr(?:om)?|track|ref|FM)=(?:r(?:ss(?:all)?|df)|atom)([&;].*)?$/defined($1) ? $1 : ''/e 
  • branches/refactoring-email/plagger/assets/plugins/Notify-IRC/irc_notify.tt

    r1570 r1906  
    1 [% IF feed.title %][% feed.title_text %]: [% END %][% entry.title_text %][% IF entry.author %] (03[% entry.author %])[% END %] - 14[% entry.permalink %] 
     1[% IF feed.title %][% feed.title_text %]: [% END %][% entry.title_text %][% IF entry.author %] (03[% entry.author %])[% END %] - 14[% entry.permalink %] 
  • branches/refactoring-email/plagger/assets/plugins/Publish-Planet/sixapart-std/template/index.tt

    r1173 r1906  
    1616  <link rel="stylesheet" type="text/css" href="[% style | html %]" /> 
    1717[% END %] 
    18   <title>[% feed.title | html %]</title> 
     18  <title>[% feed.title.html %]</title> 
    1919</head> 
    2020[% USE util = Plagger.Util -%] 
     
    2424      <div id="banner"> 
    2525        <div id="banner-inner" class="pkg"> 
    26           <h1 id="banner-header">[% feed.title | html %]</h1> 
    27           <h2 id="banner-description">[% feed.description | html %]</h2> 
     26          <h1 id="banner-header">[% feed.title.html %]</h1> 
     27          <h2 id="banner-description">[% feed.description.html %]</h2> 
    2828        </div> 
    2929      </div> 
     
    3333            <div id="alpha-inner" class="pkg"> 
    3434              [% FOREACH entry = entries %] 
    35               <a id="[% entry.id %]"></a> 
    36               <div class="entry" id="entry-[% entry.id %]"> 
     35              <a id="[% entry.id_safe %]"></a> 
     36              <div class="entry" id="entry-[% entry.id_safe %]"> 
    3737                <h3 class="entry-header"> 
    3838                [% IF entry.source.title %] 
    39                 <a href="[% entry.source.link | html %]">[% entry.source.title | html %]</a>:  
     39                <a href="[% entry.source.link | html %]">[% entry.source.title.html %]</a>:  
    4040                [% END %] 
    41                 <a href="[% (entry.permalink || entry.id) | html %]">[% entry.title | html %]</a> 
     41                <a href="[% entry.permalink | html %]">[% entry.title.html %]</a> 
    4242                </h3> 
    4343                <div class="entry-content"> 
    4444                [% IF entry.icon %]<div class="entry-userpic"><img src="[% entry.icon.url | html %]" [% util.dumbnail(entry.icon, width=150, height=100) %] border="0" alt="[% (entry.icon.title || entry.title) | html %]" /></div>[% END %] 
    4545                  <div class="entry-body"> 
    46                   [% entry.body %] 
     46                  [% entry.body.html %] 
    4747                  <p class="entry-footer"> 
    4848                    <span class="post-footers">Posted 
     
    7171                    [% FOREACH member = members %] 
    7272                    <li class="module-list-item"> 
    73                     <a  href="[% member.link | html %]">[% member.title | html %]</a> 
     73                    <a  href="[% member.link | html %]">[% member.title.html %]</a> 
    7474                    </li> 
    7575                    [% END %] 
  • branches/refactoring-email/plagger/deps/CustomFeed-Mixi.yaml

    r1206 r1906  
    22author: Tatsuhiko Miyagawa 
    33depends:  
    4   WWW::Mixi: 0.46 
     4  WWW::Mixi: 0.48 
  • branches/refactoring-email/plagger/deps/Filter-GuessTimeZoneByDomain.yaml

    r1791 r1906  
    22author: Tatsuhiko Miyagawa 
    33depends: 
    4   DateTime::TimeZone: 0.52 
    54  IP::Country: 0 
  • branches/refactoring-email/plagger/deps/Summary-GetSen.yaml

    r1777 r1906  
    33depends: 
    44  XMLRPC::Lite: 0 
     5bundles: 
     6  - Filter::GuessLanguage 
  • branches/refactoring-email/plagger/lib/Plagger.pm

    r1773 r1906  
    11package Plagger; 
    22use strict; 
    3 our $VERSION = '0.7.14'; 
     3our $VERSION = '0.7.16'; 
    44 
    55use 5.8.1; 
     
    294294        if (my $sub = $feed->aggregator) { 
    295295            $sub->($self, { feed => $feed }); 
     296            $feed->aggregator(undef); # for cloning 
    296297        } else { 
    297298            my $ok = $self->run_hook_once('customfeed.handle', { feed => $feed }); 
  • branches/refactoring-email/plagger/lib/Plagger/Date.pm

    r1749 r1906  
    2727sub parse_dwim { 
    2828    my($class, $str) = @_; 
     29 
     30    return unless defined $str; 
     31 
     32    # check if it's Japanese 
     33    if ($str =~ /^(\x{5E73}\x{6210}|\x{662D}\x{548C}|\x{5927}\x{6B63}|\x{660E}\x{6CBB})/) { 
     34        eval { require DateTime::Format::Japanese }; 
     35        if ($@) { 
     36            Plagger->context->log(warn => "requires DateTime::Format::Japanese to parse '$str'"); 
     37            return; 
     38        } 
     39        return $class->parse( 'Japanese', encode_utf8($str) ); 
     40    } 
    2941 
    3042    require Date::Parse; 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin.pm

    r1734 r1906  
    154154    } 
    155155 
     156    # ignore .svn directories 
     157     $rule->or( 
     158         $rule->new->directory->name('.svn')->prune->discard, 
     159         $rule->new, 
     160     ); 
     161 
    156162    # $rule isa File::Find::Rule 
    157163    for my $file ($rule->in($self->assets_dir)) { 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm

    r1769 r1906  
    8888    $feed->language($remote->language); 
    8989    $feed->author(_u($remote->author)); 
    90     $feed->updated($remote->modified)
     90    $feed->updated($remote->modified) if defined $remote->modified
    9191 
    9292    Encode::_utf8_on($$xml_ref); 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Bundle/Planet.pm

    r1744 r1906  
    1818        module => 'Filter::StripTagsFromTitle', 
    1919    }); 
     20 
     21    eval { require HTML::Tidy }; 
     22    unless ($@) { 
     23        $context->load_plugin({ 
     24            module => 'Filter::HTMLTidy', 
     25        }); 
     26    } 
    2027 
    2128    $context->load_plugin({ 
     
    8289            filename => 'atom.xml', 
    8390            format => 'Atom', 
     91            taguri_base => URI->new($self->conf->{url})->host, 
    8492        }, 
    8593    }); 
     
    145153=item Filter::StripTagsFromTitle 
    146154 
     155=item Filter::HTMLTidy (if HTML::Tidy is available) 
     156 
    147157=item Filter::HTMLScrubber 
    148158 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Debug.pm

    r1473 r1906  
    2424    my ($self, $context, $args) = @_; 
    2525 
    26     my $feed = Plagger::Feed->new
     26    my $feed = $args->{feed}
    2727    $feed->type('debug'); 
    2828    for (keys %{$self->conf}) { 
    29         next if $_ eq 'entry'
     29        next if $_ eq 'entry' || $_ eq 'entries'
    3030        $feed->$_($self->conf->{$_}); 
    3131    } 
    3232 
    33     for my $entry_conf (@{$self->conf->{entry}}) { 
     33    for my $entry_conf (@{ $self->conf->{entry} || $self->conf->{entries} || [] }) { 
    3434        my $entry = Plagger::Entry->new; 
    35         $entry->$_($entry_conf->{$_}) for keys %$entry_conf; 
     35        for my $method (keys %$entry_conf) { 
     36            next if $method eq 'enclosure'; 
     37            $entry->$method($entry_conf->{$method}); 
     38        } 
    3639        $feed->add_entry($entry); 
    3740 
    3841        # enclosure 
    39         for my $enclosure_conf ( @{ $entry_conf->{enclosure} } ){ 
     42        my $encls = $entry_conf->{enclosure} || []; 
     43           $encls = [ $encls ] if ref $encls && ref $encls ne 'ARRAY'; 
     44 
     45        for my $enclosure_conf ( @$encls ) { 
    4046            my $enclosure = Plagger::Enclosure->new; 
    4147            $enclosure->$_($enclosure_conf->{$_}) for keys %$enclosure_conf; 
     48            $enclosure->auto_set_type unless defined $enclosure->type; 
    4249            $entry->add_enclosure($enclosure); 
    4350        } 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Mailman.pm

    r480 r1906  
    7171 
    7272    my @matches; 
    73     while ($content =~ m!<LI><A HREF="(\d+\.html)">(.*?)\n</A><A NAME="(\d+)">&nbsp;</A>\n<I>(.*?)\n</I>!g) { 
    74         push @matches,
     73    while ($content =~ m!<LI><A HREF="(\d+\.html)">(.*?)\n</A><A NAME="(\d+)">&nbsp;</A>\n<I>(.*?)\n</I>!sg) { 
     74        my $data =
    7575            link    => $1, 
    7676            subject => $2, 
     
    7878            from    => $4, 
    7979        }; 
     80        $data->{subject} =~ tr/\n//d; 
     81        push @matches, $data; 
    8082    } 
    8183 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Mixi.pm

    r1784 r1906  
    179179                    my $meth = $MAP->{$type}->{get_detail}; 
    180180                    my($item) = $self->{mixi}->$meth($msg->{link}); 
     181 
     182                    if ($meth eq 'get_view_diary') { 
     183                        $item->{images} = $self->get_images($self->{mixi}->response->content); 
     184                    } 
    181185                    $item; 
    182186                }, 
     
    187191                   $body =~ s!(\r\n?|\n)!<br />!g; 
    188192                for my $image (@{ $item->{images} }) { 
    189                     # xxx this should be $entry->enclosures 
    190193                    $body .= qq(<div><a href="$image->{link}"><img src="$image->{thumb_link}" style="border:0" /></a></div>); 
     194                    my $enclosure = Plagger::Enclosure->new; 
     195                    $enclosure->url( URI->new($image->{thumb_link}) ); 
     196                    $enclosure->auto_set_type; 
     197                    $enclosure->is_inline(1); 
     198                    $entry->add_enclosure($enclosure); 
    191199                } 
    192200                $entry->body($body); 
     
    203211 
    204212    $context->update->add($feed); 
     213} 
     214 
     215sub get_images { 
     216    my($self, $content) = @_; 
     217 
     218    my @images; 
     219    while ($content =~ m!MM_openBrWindow\('(show_diary_picture\.pl\?.*?)',.*?><img src="(http://ic\d+\.mixi\.jp/p/.*?)"!g) { 
     220        push @images, { link => "http://mixi.jp/$1", thumb_link => $2 }; 
     221    } 
     222 
     223    return \@images; 
    205224} 
    206225 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/MixiDiarySearch.pm

    r992 r1906  
    5858<table BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=550> 
    5959<tr> 
    60 <td WIDTH=90 VALIGN=top ROWSPAN=5 ALIGN=center background=http://img\.mixi\.jp/img/bg_line\.gif><a href="(view_diary\.pl\?id=\d+&owner_id=\d+)"><img SRC="(http://img\.mixi\.jp/photo/member/.*?\.\w+)" VSPACE=3 border=0></a></td> 
     60<td WIDTH=90 VALIGN=top ROWSPAN=5 ALIGN=center background=http://img\.mixi\.jp/img/bg_line\.gif><a href="(view_diary\.pl\?id=\d+&owner_id=\d+)"><img SRC="(http://img-p\d+\.mixi\.jp/photo/member/.*?\.\w+)" VSPACE=3 border=0></a></td> 
    6161<td BGCOLOR=#FDF9F2><font COLOR=#996600>名&nbsp;&nbsp;前</font></td> 
    6262<td COLSPAN=2 BGCOLOR=#FFFFFF>(.*?) \(.*?\) 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/POP3.pm

    r1172 r1906  
    6767    $entry->title($email->header('Subject')); 
    6868    $entry->author($email->header('From')); 
    69     $entry->date(Plagger::Date->parse($format, $email->header('Date'))) if $email->header('Date'); 
     69 
     70    if (my $date = $email->header('Date')) { 
     71        my $dt = eval { Plagger::Date->parse($format, $date) } 
     72            || Plagger::Date->parse_dwim($date); 
     73        $entry->date($dt) if $dt; 
     74    } 
     75 
    7076    $entry->body($self->get_body($email)); 
    7177 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Simple.pm

    r1686 r1906  
    4545 
    4646    my $content = decode_content($res); 
    47     my $title   = extract_title($content); 
    4847 
    4948    my $feed = Plagger::Feed->new; 
    50     $feed->title($title); 
     49    $feed->title($args->{feed}->title || extract_title($content)); 
    5150    $feed->link($url); 
    5251 
     
    6362            next if !$text || $text eq '[IMG]'; 
    6463 
    65             my $url = URI->new_abs($token->[1]->{href}, $url); 
    66             next if $seen{$url->as_string}++; 
     64            my $item_url = URI->new_abs($token->[1]->{href}, $url); 
     65            next if $seen{$item_url->as_string}++; 
    6766 
    6867            my $entry = Plagger::Entry->new; 
    6968            $entry->title($text); 
    70             $entry->link($url); 
     69            $entry->link($item_url); 
    7170            $feed->add_entry($entry); 
    7271 
     
    8483            my $entry = Plagger::Entry->new; 
    8584            $entry->title($title); 
    86             $entry->link($href); 
     85            $entry->link(URI->new_abs($href, $url)); 
    8786            $feed->add_entry($entry); 
    8887 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/YouTube.pm

    r1775 r1906  
    6868            m!<div class="vtitle">! 
    6969                and $title_flag = 1; 
    70             m!<a href="/watch\?v=([^"]+)">(.+)</a>! 
     70            m!<a href="/watch\?v=([^"]+)"[^>]+>(.+)</a>! 
    7171                and do { 
    7272                    if($title_flag){ 
     
    7676                    } 
    7777                }; 
    78             m!<img src="(http://[\w-]*static\d+(.[\w-]+)?\.youtube.com/[^">]+/[12].jpg)" class="vimg120" />! 
     78            # get image url 
     79            m!<img src="(http://[\w-]*static\d+(.[\w-]+)?\.youtube.com/[^">]+/[12].jpg)" border="0" class="vimg120" />! 
    7980                and $data->{image}->{url} = $1; 
     81            # get description 
    8082            m!<div class="vdesc">! 
    81                 and $data->{description} = <$fh>; 
     83                and do { 
     84                    <$fh>; 
     85                    $data->{description} = <$fh>; 
     86                }; 
     87            # get tags 
    8288            m!<div class="vtagLabel">Tags:</div>! 
    8389                and $tag_flag = 1; 
    84             m!(<a href="/results\?search_type=.*)! 
     90            m!(<a href="/results\?search_query=.*)! 
    8591                and do { 
    8692                    if($tag_flag){ 
     
    8995                    } 
    9096                }; 
    91             m!profile\?user=([^"]+)! 
     97            # get author 
     98            m!From:</span> <a href="/user/[^>]+">([^<]+)</a>! 
     99                and $data->{author} = $1; 
     100            m/<!-- end vEntry -->/ 
    92101                and do { 
    93102                    $context->log( info => 'Got ' . $data->{title}); 
    94                     $data->{author} = $1; 
    95103                    my $entry = Plagger::Entry->new; 
    96104                    $entry->title($data->{title}); 
     
    106114 
    107115                    # tags 
    108                     while( $data->{tags} =~ /<a href="\/results\?search_type=[^"]+" class="dg">([^<]+)<\/a>/gms){ 
     116                    while( $data->{tags} =~ /<a href="\/results\?search_query=[^"]+" class="dg">([^<]+)<\/a>/gms){ 
    109117                        $entry->add_tag($1); 
    110118                    } 
     
    129137                    if ($video_url) { 
    130138                        my $video_id = ( $video_url =~ /video_id=(\w+)/ )[0]; 
    131  
    132139                        my $enclosure = Plagger::Enclosure->new; 
    133140                        $enclosure->url( URI->new($video_url) ); 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/2chRSSContent.pm

    r1417 r1906  
    1414    my($self, $context, $args) = @_; 
    1515 
    16     return unless $args->{entry}->link =~ m!\.2ch\.net/test/read\.cgi|rss\.s2ch\.net/test/\-/!; 
     16    return unless $args->{entry}->link =~ m!\.2ch\.net/test/read\.cgi|rss\.s2ch\.net/test(\.cgi)?/\-/!; 
    1717 
    1818    my $body = $args->{entry}->body; 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/Babelfish.pm

    r1741 r1906  
    5252    }; 
    5353 
    54     my $title    = $args->{entry}->title
     54    my $title    = $args->{entry}->title->data
    5555    my $title_tr = $self->translate($translator, $title, $language); 
    5656    unless (defined $title_tr) { 
     
    6464    sleep 1; 
    6565 
    66     my $body    = $args->{entry}->body
     66    my $body    = $args->{entry}->body->data
    6767    my $body_tr = $self->translate($translator, $body, $language); 
    6868    unless (defined $body_tr) { 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r1741 r1906  
    125125 
    126126    # use Last-Modified to populate entry date, even if handler doesn't find one 
     127    # TODO: make this a separate plugin 
    127128    if ($res->last_modified && !$args->{entry}->date) { 
    128129        $args->{entry}->date( Plagger::Date->from_epoch($res->last_modified) ); 
     
    131132    my @plugins = $handler ? ($handler) : @{ $self->{plugins} }; 
    132133 
     134    my $upgraded; 
    133135    for my $plugin (@plugins) { 
    134136        if ( $handler || $plugin->handle($args) ) { 
     
    157159                } 
    158160 
    159                 return 1; 
     161                $upgraded++; 
     162                last; 
    160163            } 
    161164        } 
    162165    } 
     166 
     167    # extract TITLE tag if title is not set yet 
     168    # TODO: make this a separate plugin 
     169    if (!$args->{entry}->title 
     170        and $args->{content} =~ m!<title>\s*(.*?)\s*</title>!is ) { 
     171        $args->{entry}->title( HTML::Entities::decode($1) ); 
     172    } 
     173 
     174    return 1 if $upgraded; 
    163175 
    164176    # failed to extract: store whole HTML if the config is on 
     
    247259    my $data; 
    248260 
     261    unless ($self->{extract} || $self->{extract_xpath}) { 
     262        Plagger->context->log(error => "YAML doesn't have either 'extract' nor 'extract_xpath'"); 
     263        return; 
     264    } 
     265 
    249266    if ($self->{extract}) { 
    250267        if (my @match = $args->{content} =~ /$self->{extract}/s) { 
     
    271288                no warnings 'redefine'; 
    272289                local *HTML::Element::_xml_escape = \&xml_escape; 
    273                 $data->{$capture} = $children[0]->as_XML; 
     290                $data->{$capture} = $children[0]->isElementNode 
     291                    ? $children[0]->as_XML 
     292                    : $children[0]->getValue; 
    274293            } else { 
    275294                Plagger->context->log(error => "Can't find node matching $self->{extract_xpath}->{$capture}"); 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/HTMLScrubber.pm

    r1741 r1906  
    9393 
    9494    if (defined $args->{entry}->body && $args->{entry}->body->is_html) { 
    95         $context->log(debug => "Scrubbing body for" . $args->{entry}->permalink || '(no-link)'); 
     95        $context->log(debug => "Scrubbing body for " . $args->{entry}->permalink || '(no-link)'); 
    9696        my $body = $self->{scrubber}->scrub( $args->{entry}->body ); 
    9797        $args->{entry}->body($body); 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/HatenaDiaryKeywordUnlink.pm

    r545 r1906  
    1515    my $body = $args->{entry}->body; 
    1616 
    17     my $count = $body =~ s!<a class="o?keyword" href="http://(?:d|[\w\-]+\.g)\.hatena\.ne\.jp/keyword/.*?"[^>]*?>(.*?)</a>!$1!g; 
     17    my $count = $body =~ s!<a (?:class="o?keyword"\s*)?href="http://(?:(?:d|[\w\-]+\.g)\.hatena\.ne\.jp|anond\.hatelabo\.jp)/keyword/.*?"(?:\s*class="keyword")?[^>]*>(.*?)</a>!$1!g; 
    1818 
    1919    if ($count) { 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Namespace/MediaRSS.pm

    r1769 r1906  
    1414    my($self, $context, $args) = @_; 
    1515 
    16     my $media_ns = "http://search.yahoo.com/mrss"; 
    17     my $media = $args->{orig_entry}->{entry}->{$media_ns}->{group} || $args->{orig_entry}->{entry}; 
    18     my $content = $media->{$media_ns}->{content} || []; 
    19     $content = [ $content ] unless ref $content && ref $content eq 'ARRAY'; 
     16    # Ick, I need to try the URL with and without the trailing slash 
     17    for my $media_ns ("http://search.yahoo.com/mrss", "http://search.yahoo.com/mrss/") { 
     18        my $media = $args->{orig_entry}->{entry}->{$media_ns}->{group} || $args->{orig_entry}->{entry}; 
     19        my $content = $media->{$media_ns}->{content} || []; 
     20        $content = [ $content ] unless ref $content && ref $content eq 'ARRAY'; 
    2021 
    21     for my $media_content (@{$content}) { 
    22         my $enclosure = Plagger::Enclosure->new; 
    23         $enclosure->url( URI->new($media_content->{url}) ); 
    24         $enclosure->auto_set_type($media_content->{type}); 
    25         $args->{entry}->add_enclosure($enclosure); 
    26    
     22        for my $media_content (@{$content}) { 
     23            my $enclosure = Plagger::Enclosure->new; 
     24            $enclosure->url( URI->new($media_content->{url}) ); 
     25            $enclosure->auto_set_type($media_content->{type}); 
     26            $args->{entry}->add_enclosure($enclosure); 
     27       
    2728 
    28     if (my $thumbnail = $media->{$media_ns}->{thumbnail}) { 
    29         $args->{entry}->icon({ 
    30             url   => $thumbnail->{url}, 
    31             width => $thumbnail->{width}, 
    32             height => $thumbnail->{height}, 
    33         }); 
     29        if (my $thumbnail = $media->{$media_ns}->{thumbnail}) { 
     30            $args->{entry}->icon({ 
     31                url   => $thumbnail->{url}, 
     32                width => $thumbnail->{width}, 
     33                height => $thumbnail->{height}, 
     34            }); 
     35        } 
    3436    } 
    3537 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Excel.pm

    r1196 r1906  
    44use base qw(Plagger::Plugin); 
    55 
    6 use Plagger::Util qw(strip_html); 
    76use Spreadsheet::WriteExcel; 
    87 
     
    4039        $worksheet->write($row, $col++, $entry->title); 
    4140        $worksheet->write($row, $col++, $entry->permalink); 
    42         $worksheet->write($row, $col++, strip_html($entry->body), $self->{body_format}); 
     41        $worksheet->write($row, $col++, $entry->body->plaintext, $self->{body_format}); 
    4342        $row++; 
    4443    } 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Feed.pm

    r1741 r1906  
    66use XML::Feed; 
    77use XML::Feed::Entry; 
     8use XML::Feed::RSS; # load explicitly to force LibXML 
    89use XML::RSS::LibXML; 
    910use File::Spec; 
     
    5253        if $f->primary_author; 
    5354 
     55    my $taguri_base = $self->conf->{taguri_base} || do { 
     56        require Sys::Hostname; 
     57        Sys::Hostname::hostname(); 
     58    }; 
     59 
    5460    if ($feed_format eq 'Atom') { 
    55         $feed->{atom}->id("tag:plagger.org,2006:" . $f->id); 
     61        $feed->{atom}->id("tag:$taguri_base,2006:" . $f->id); # XXX what if id is empty? 
    5662    } 
    5763 
     
    6874                $entry->content($e->body); 
    6975            } else { 
    70                 $entry->{entry}->content($e->body); 
     76                $entry->{entry}->content($e->body->utf8); 
    7177            } 
    7278        } 
    7379 
    74         $entry->category(join(' ', @{$e->tags}))
     80        $entry->category(join(' ', @{$e->tags})) if @{$e->tags}
    7581        $entry->issued($e->date)   if $e->date; 
    7682        $entry->modified($e->date) if $e->date; 
    7783 
    78         $entry->author( $self->make_author($e->author, $feed_format) ); 
    7984        if ($feed_format eq 'RSS') { 
    8085            my $author = 'nobody@example.com'; 
     
    8792        } 
    8893 
    89         $entry->id("tag:plagger.org,2006:" . $e->id); 
     94        $entry->id("tag:$taguri_base,2006:" . $e->id); 
    9095 
    9196        if ($e->has_enclosure) { 
     
    211216Whether to publish full content feed. Defaults to 1. 
    212217 
     218=item taguri_base 
     219 
     220Domain name to use with Tag URI base for Atom feed IDs. If it's not 
     221set, the domain is grabbed using Sys::Hostname module Optional. 
     222 
    213223=back 
    214224 
    215225=head1 AUTHOR 
    216226 
     227Tatsuhiko Miyagawa 
     228 
     229=head1 CONTRIBUTORS 
     230 
    217231Yoshiki Kurihara 
    218232 
    219 Tatsuhiko Miyagawa 
    220  
    221233Gosuke Miyashita 
    222234 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Gmail.pm

    r1792 r1906  
    107107                Password => $route->{password}, 
    108108                Port     => $route->{port} || 587, 
     109                Timeout  => $route->{timeout} || 300, 
    109110            ]; 
    110111            $msg->send_by_smtp_tls(@{ $self->{tls_args} }); 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/Bloglines.pm

    r1734 r1906  
    6666    my($self, $context) = @_; 
    6767 
    68     my $count = $self->{bloglines}->notify(); 
    69     $context->log(info => "You have $count unread item(s) on Bloglines."); 
    70     if ($count) { 
     68    my $to_fetch = $self->conf->{dont_use_notifier_api}; 
     69    unless ($to_fetch) { 
     70        my $count = $self->{bloglines}->notify(); 
     71        $context->log(info => "You have $count unread item(s) on Bloglines."); 
     72        $to_fetch = $count; 
     73    } 
     74 
     75    if ($to_fetch) { 
    7176        my $feed = Plagger::Feed->new; 
    7277        $feed->aggregator(sub { $self->sync(@_) }); 
     
    248253You can use this tags information using Rules in later phase. 
    249254 
     255=item dont_use_notifier_api 
     256 
     257Turn it on when you want to skip Notifier API, which could sometimes 
     258be broken and always returns 0 instead of the actual unread count. 
     259 
    250260=back 
    251261 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/Feed.pm

    r861 r1906  
    55use base qw( Plagger::Plugin ); 
    66use Plagger::Util; 
    7  
    8 use XML::Feed; 
     7use Plagger::FeedParser; 
    98 
    109sub register { 
     
    3029 
    3130    my $content = Plagger::Util::load_uri($uri); 
    32     my $feed = eval { XML::Feed->parse(\$content) }; 
     31    my $feed = eval { Plagger::FeedParser->parse(\$content) }; 
    3332 
    3433    unless ($feed) { 
    35         $context->log( error => "Error loading feed $uri: " . ($@ || XML::Feed->errstr) ); 
     34        $context->log( error => "Error loading feed $uri: $@" ); 
    3635        return; 
    3736    } 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/HatenaGroup.pm

    r361 r1906  
    44 
    55use URI; 
    6 use XML::Feed; 
     6use Plagger::FeedParser; 
     7use Plagger::UserAgent; 
    78 
    89sub register { 
     
    2324    my $feed_uri = "http://$group.g.hatena.ne.jp/diarylist?mode=rss"; 
    2425 
    25     my $remote = XML::Feed->parse(URI->new($feed_uri)) or $context->error("feed parse error $feed_uri"); 
     26    my $agent = Plagger::UserAgent->new; 
     27    my $remote = eval { $agent->fetch_parse(URI->new($feed_uri)) } 
     28        or $context->error("feed parse error $feed_uri: $@"); 
    2629    for my $r ($remote->entries) { 
    2730        $context->log(info => "diary: ". $r->link); 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/LivedoorReader.pm

    r1734 r1906  
    7676        my $feed = Plagger::Feed->new; 
    7777        $feed->type('livedoorReader'); 
    78         $feed->title( Plagger::Util::strip_html($data->{channel}->{title}) ); 
     78        $feed->title($data->{channel}->{title}); 
    7979        $feed->link($data->{channel}->{link}); 
    8080        $feed->url($data->{channel}->{feedlink}); 
  • branches/refactoring-email/plagger/lib/Plagger/Plugin/Summary/Simple.pm

    r1779 r1906  
    2121        local $HTML::Tagset::isBodyElement{div} = 0; 
    2222        my $html = $text->data; 
    23         while ($html =~ s|^\s*<(\w*)\s*[^>]*>(.*?)</\1>|$2|gs) { 
     23        while ($html =~ s|^\s*<([^ >]+)(?:\s+[^>]+)?>(.*?)</\1>|$2|gs) { 
    2424            if ($HTML::Tagset::isBodyElement{lc($1)}) { 
    2525                return "<$1>$2</$1>"; 
  • branches/refactoring-email/plagger/lib/Plagger/Util.pm

    r1741 r1906  
    215215 
    216216sub safe_id { 
    217     my $id = shift; 
     217    my $id = "$_[0]"; # force stringify 
    218218    $id =~ s/^urn:guid://; 
    219219    $id =~ /^([\w\-]+)$/ ? $1 : Digest::MD5::md5_hex($id); 
  • branches/refactoring-email/plagger/t/99-pod-spell.t

    r1777 r1906  
    2929Anil 
    3030AtomPP 
     31AppleScript 
    3132AutoLink 
    3233Babelfish 
     
    6768HatenaGroup 
    6869HatenaRSS 
     70IDs 
    6971IE 
    7072IKC 
  • branches/refactoring-email/plagger/t/perlcriticrc

    r1588 r1906  
    88[TestingAndDebugging::ProhibitNoStrict] 
    99allow = refs 
     10 
     11# temporary disable this 
     12[-Modules::RequireFilenameMatchesPackage] 
  • branches/refactoring-email/plagger/t/plugins/Bundle-Planet/bundle.t

    r1483 r1906  
    4545file_contains("$main::dir/index.html", qr(href="http://planet.plagger.org/foafroll.xml")); 
    4646file_contains("$main::dir/atom.xml", qr!href="http://planet.plagger.org/"!); 
     47file_contains("$main::dir/atom.xml", qr!tag:planet.plagger.org!); 
    4748file_contains("$main::dir/rss.xml", qr!<link>http://planet.plagger.org/</link>!); 
    4849file_contains("$main::dir/subscriptions.opml", qr!<head>\s*<title>Planet Foobar</title>!); 
  • branches/refactoring-email/plagger/t/plugins/CustomFeed-Debug/test.t

    r1434 r1906  
    3333ok $context->update->feeds->[0]->entries->[1]->link; 
    3434ok $context->update->feeds->[0]->entries->[1]->body; 
     35 
     36=== Enclosures 
     37--- input config 
     38plugins: 
     39  - module: CustomFeed::Debug 
     40    config: 
     41      title: 'My Feed' 
     42      link: 'http://localhost/' 
     43      entry: 
     44        - title: 'First Entry' 
     45          link: 'http://localhost/1' 
     46          body: 'Hello World! :)' 
     47          enclosure: 
     48            url: http://example.com/foo.mp3 
     49            length: 123 
     50            type: audio/mp3 
     51 
     52        - title: 'First Entry' 
     53          link: 'http://localhost/1' 
     54          body: 'Hello World! :)' 
     55          enclosure: 
     56            - url: http://example.com/foo.mp3 
     57              length: 123 
     58            - url: http://example.com/foo.m4a 
     59              length: 456 
     60--- expected 
     61is $context->update->feeds->[0]->link, 'http://localhost/'; 
     62is $context->update->feeds->[0]->title, 'My Feed'; 
     63{ 
     64    my @e = $context->update->feeds->[0]->entries->[0]->enclosures; 
     65    is @e, 1; 
     66    isa_ok $e[0]->url, 'URI'; 
     67    is $e[0]->url, 'http://example.com/foo.mp3'; 
     68    is $e[0]->type, 'audio/mp3'; 
     69    is $e[0]->length, 123; 
     70} 
     71{ 
     72    my @e = $context->update->feeds->[0]->entries->[1]->enclosures; 
     73    is @e, 2; 
     74    isa_ok $e[0]->url, 'URI'; 
     75    is $e[0]->url, 'http://example.com/foo.mp3'; 
     76    is $e[0]->type, 'audio/mpeg'; 
     77    is $e[0]->length, 123; 
     78    is $e[1]->url, 'http://example.com/foo.m4a'; 
     79    is $e[1]->type, 'audio/aac'; 
     80    is $e[1]->length, 456; 
     81} 
     82 
     83 
  • branches/refactoring-email/plagger/t/plugins/CustomFeed-Simple/test.t

    r1427 r1906  
    2727ok $context->update->feeds->[0]->entries->[0]->title; 
    2828ok $context->update->feeds->[0]->entries->[0]->link; 
     29 
     30=== Test custom feed title 
     31--- input config 
     32plugins: 
     33  - module: Subscription::Config 
     34    config: 
     35      feed: 
     36        - url: http://sportsnavi.yahoo.co.jp/index.html 
     37          title: Sports navi custom! 
     38          meta: 
     39            follow_link: /headlines/ 
     40         
     41  - module: CustomFeed::Simple 
     42 
     43--- expected 
     44is $context->update->feeds->[0]->link, 'http://sportsnavi.yahoo.co.jp/index.html'; 
     45ok $context->update->feeds->[0]->count; 
     46ok $context->update->feeds->[0]->entries->[0]->title; 
     47ok $context->update->feeds->[0]->entries->[0]->link; 
     48is $context->update->feeds->[0]->title, 'Sports navi custom!'; 
     49 
  • branches/refactoring-email/plagger/t/plugins/Filter-Babelfish/babelfish.t

    r1483 r1906  
    4343      source: Japanese 
    4444      destination: English 
    45       service: Google 
     45#      service: Google 
    4646      prepend_original: 0 
    4747--- expected 
     
    6565      source: Japanese 
    6666      destination: English 
    67       service: Google 
     67#      service: Google 
    6868      prepend_original: 1 
    6969--- expected 
     
    8787#      source: Japanese 
    8888      destination: English 
    89       service: Google 
     89#      service: Google 
    9090      prepend_original: 0 
    9191--- expected 
  • branches/refactoring-email/plagger/t/plugins/Filter-EntryFullText/slashdot.t

    r1332 r1906  
    2121        - title: Slashdot.jp 
    2222          link: http://slashdot.jp/article.pl?sid=06/08/14/1941259 
     23        - title: foo 
     24          link: http://slashdot.jp/developers/article.pl?sid=06/10/31/0418208 
    2325  - module: Filter::EntryFullText 
    2426--- expected 
    2527ok $context->update->feeds->[0]->entries->[0]->body; 
     28ok $context->update->feeds->[0]->entries->[1]->body; 
    2629 
  • branches/refactoring-email/plagger/t/plugins/Filter-HatenaDiaryKeywordUnlink/base.t

    r1444 r1906  
    1515      entry: 
    1616        - title: bar 
    17           body: <a class="keyword" href="http://d.hatena.ne.jp/keyword/Plagger">Plagger</a> is a pluggable aggregator 
     17          body: <a class="keyword" href="http://d.hatena.ne.jp/keyword/Plagger">Plagger</a> is a pluggable aggregator, which is so to say the duct tape of the <a href="http://anond.hatelabo.jp/keyword/Web" class="keyword">Web</a> 
    1818  - module: Filter::HatenaDiaryKeywordUnlink 
    1919--- expected 
    20 is $context->update->feeds->[0]->entries->[0]->body, "Plagger is a pluggable aggregator
     20is $context->update->feeds->[0]->entries->[0]->body, "Plagger is a pluggable aggregator, which is so to say the duct tape of the Web
  • branches/refactoring-email/plagger/t/plugins/Namespace-MediaRSS/base.t

    r1769 r1906  
    44use t::TestPlagger; 
    55 
    6 plan tests => 6
     6plan tests => 8
    77run_eval_expected; 
    88 
     
    2020        - file://$t::TestPlagger::BaseDirURI/t/samples/monkey.rss 
    2121        - file://$t::TestPlagger::BaseDirURI/t/samples/googlevideo.xml 
     22        - file://$t::TestPlagger::BaseDirURI/t/samples/flickr_new.xml 
    2223--- expected 
    2324my @feeds = $context->update->feeds; 
    2425 
    25 is( ($feeds[0]->entries)[0]->enclosures->[0]->url, 'http://youtube.com/v/MgldehkjK5k.swf' ); 
    26 is( ($feeds[0]->entries)[0]->enclosures->[0]->type, 'application/x-shockwave-flash' ); 
    27 is( ($feeds[0]->entries)[0]->icon->{url}, 'http://sjl-static4.sjl.youtube.com/vi/MgldehkjK5k/2.jpg' ); 
    28 is( ($feeds[1]->entries)[0]->enclosures->[0]->type, 'video/mp4' ); 
    29 is( ($feeds[1]->entries)[0]->enclosures->[1]->type, 'video/x-flv' ); 
    30 is( ($feeds[1]->entries)[0]->icon->{url}, 'http://video.google.com/ThumbnailServer?app=vss&contentid=ac22092b58659308&second=5&itag=w320&urlcreated=1148908032&sigh=oxDLuV7bChBhYFMFSFamVpkIHHE' ); 
     26is $feeds[0]->entries->[0]->enclosures->[0]->url, 'http://youtube.com/v/MgldehkjK5k.swf'; 
     27is $feeds[0]->entries->[0]->enclosures->[0]->type, 'application/x-shockwave-flash'; 
     28is $feeds[0]->entries->[0]->icon->{url}, 'http://sjl-static4.sjl.youtube.com/vi/MgldehkjK5k/2.jpg'; 
     29 
     30is $feeds[1]->entries->[0]->enclosures->[0]->type, 'video/mp4'; 
     31is $feeds[1]->entries->[0]->enclosures->[1]->type, 'video/x-flv'; 
     32is $feeds[1]->entries->[0]->icon->{url}, 'http://video.google.com/ThumbnailServer?app=vss&contentid=ac22092b58659308&second=5&itag=w320&urlcreated=1148908032&sigh=oxDLuV7bChBhYFMFSFamVpkIHHE'; 
     33 
     34is $feeds[2]->entries->[0]->enclosures->[0]->type, 'image/jpeg'; 
     35is $feeds[2]->entries->[0]->enclosures->[0]->url, 'http://static.flickr.com/109/313831333_60eb5e65b5_m.jpg'; 
    3136 
    3237 
     38 
  • branches/refactoring-email/plagger/t/plugins/Publish-Feed/atom1.t

    r1358 r1906  
    88 
    99test_plugin_deps; 
    10 plan tests => 2
     10plan tests => 4
    1111run_eval_expected; 
    1212 
     
    3434is $feed->version, '1.0'; 
    3535is $feed->title, 'Bulknews::Subtech'; 
     36unlike( ($feed->entries)[0]->content->as_xml, qr/CgkJPGRpdiBjbGFz/); 
     37file_doesnt_contain($main::output, qr!<content xmlns="http://www.w3.org/2005/Atom">!); 
     38 
  • branches/refactoring-email/plagger/t/plugins/Summary-Simple/base.t

    r1778 r1906  
    8282<p>First paragraph</p> 
    8383 
     84=== Make sure element names are extracted properly 
     85--- input 
     86<img src="..."> <i><a href="...">more text</a></i> some more text 
     87--- expected 
     88<img src="..."> <i><a href="...">more text</a></i> some more text 
     89 
    8490=== I18N. Japanese plaintext 
    8591--- input