Changeset 1906
- Timestamp:
- 12/05/06 08:02:16
- Files:
-
- branches/refactoring-email/plagger (modified) (previous)
- branches/refactoring-email/plagger/AUTHORS (modified) (1 diff)
- branches/refactoring-email/plagger/Changes (modified) (1 diff)
- branches/refactoring-email/plagger/MANIFEST (modified) (9 diffs)
- branches/refactoring-email/plagger/Makefile.PL (modified) (3 diffs)
- branches/refactoring-email/plagger/assets/plugins/CustomFeed-Script/slims_calendar.pl (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/baltimoresun_com.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/catalyst_advent.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/dsp_co_jp.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/gigazine_net.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/hatena_serif.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/mt2.pl (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/news_3yen_com.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/nifty_com_usuta.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/pmachine.pl (modified) (1 diff)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/slashdot_jp.yaml (modified) (1 diff)
- branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/talesweaver_news.yaml (added)
- branches/refactoring-email/plagger/assets/plugins/Filter-TruePermalink/2chrss.yaml (modified) (1 diff)
- branches/refactoring-email/plagger/assets/plugins/Filter-TruePermalink/refrss.yaml (modified) (1 diff)
- branches/refactoring-email/plagger/assets/plugins/Notify-IRC/irc_notify.tt (modified) (1 diff)
- branches/refactoring-email/plagger/assets/plugins/Publish-Planet/sixapart-std/template/index.tt (modified) (4 diffs)
- branches/refactoring-email/plagger/deps/CustomFeed-Mixi.yaml (modified) (1 diff)
- branches/refactoring-email/plagger/deps/Filter-DegradeYouTube.yaml (added)
- branches/refactoring-email/plagger/deps/Filter-GuessTimeZoneByDomain.yaml (modified) (1 diff)
- branches/refactoring-email/plagger/deps/Filter-HTMLTidy.yaml (added)
- branches/refactoring-email/plagger/deps/Summary-AppleScript.yaml (added)
- branches/refactoring-email/plagger/deps/Summary-GetSen.yaml (modified) (1 diff)
- branches/refactoring-email/plagger/deps/Summary-Japanese.yaml (added)
- branches/refactoring-email/plagger/lib/Plagger.pm (modified) (2 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Date.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Bundle/Planet.pm (modified) (3 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Debug.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Mailman.pm (modified) (2 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Mixi.pm (modified) (3 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/MixiDiarySearch.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/POP3.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Simple.pm (modified) (3 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/YouTube.pm (modified) (5 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/2chRSSContent.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/Babelfish.pm (modified) (2 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/DegradeYouTube.pm (added)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm (modified) (5 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/HTMLScrubber.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/HTMLTidy.pm (added)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/HatenaDiaryKeywordUnlink.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Namespace/MediaRSS.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Excel.pm (modified) (2 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Feed.pm (modified) (5 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Gmail.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/Bloglines.pm (modified) (2 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/Feed.pm (modified) (2 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/HatenaGroup.pm (modified) (2 diffs)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/LivedoorReader.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Summary/AppleScript.pm (added)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Summary/Japanese.pm (added)
- branches/refactoring-email/plagger/lib/Plagger/Plugin/Summary/Simple.pm (modified) (1 diff)
- branches/refactoring-email/plagger/lib/Plagger/Util.pm (modified) (1 diff)
- branches/refactoring-email/plagger/t/99-pod-spell.t (modified) (2 diffs)
- branches/refactoring-email/plagger/t/core/date-parse-jp.t (added)
- branches/refactoring-email/plagger/t/perlcriticrc (modified) (1 diff)
- branches/refactoring-email/plagger/t/plugins/Bundle-Planet/bundle.t (modified) (1 diff)
- branches/refactoring-email/plagger/t/plugins/Bundle-Planet/html.t (added)
- branches/refactoring-email/plagger/t/plugins/CustomFeed-Debug/test.t (modified) (1 diff)
- branches/refactoring-email/plagger/t/plugins/CustomFeed-Simple/test.t (modified) (1 diff)
- branches/refactoring-email/plagger/t/plugins/Filter-Babelfish/babelfish.t (modified) (3 diffs)
- branches/refactoring-email/plagger/t/plugins/Filter-DegradeYouTube (added)
- branches/refactoring-email/plagger/t/plugins/Filter-DegradeYouTube/base.t (added)
- branches/refactoring-email/plagger/t/plugins/Filter-EntryFullText/catalyst.t (added)
- branches/refactoring-email/plagger/t/plugins/Filter-EntryFullText/mt2.t (added)
- branches/refactoring-email/plagger/t/plugins/Filter-EntryFullText/serif.t (added)
- branches/refactoring-email/plagger/t/plugins/Filter-EntryFullText/slashdot.t (modified) (1 diff)
- branches/refactoring-email/plagger/t/plugins/Filter-HTMLTidy (added)
- branches/refactoring-email/plagger/t/plugins/Filter-HTMLTidy/base.t (added)
- branches/refactoring-email/plagger/t/plugins/Filter-HatenaDiaryKeywordUnlink/base.t (modified) (1 diff)
- branches/refactoring-email/plagger/t/plugins/Namespace-MediaRSS/base.t (modified) (2 diffs)
- branches/refactoring-email/plagger/t/plugins/Publish-Feed/atom1-nobody.t (added)
- branches/refactoring-email/plagger/t/plugins/Publish-Feed/atom1.t (modified) (2 diffs)
- branches/refactoring-email/plagger/t/plugins/Publish-Feed/empty-tags.t (added)
- branches/refactoring-email/plagger/t/plugins/Publish-Feed/taguri.t (added)
- branches/refactoring-email/plagger/t/plugins/Summary-AppleScript (added)
- branches/refactoring-email/plagger/t/plugins/Summary-AppleScript/base.t (added)
- branches/refactoring-email/plagger/t/plugins/Summary-Japanese (added)
- branches/refactoring-email/plagger/t/plugins/Summary-Japanese/base.t (added)
- branches/refactoring-email/plagger/t/plugins/Summary-Simple/base.t (modified) (1 diff)
- branches/refactoring-email/plagger/t/samples/flickr_new.xml (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/refactoring-email/plagger/AUTHORS
r1734 r1906 39 39 Kentaro Kuribayashi 40 40 Koichi Taniguchi 41 Nik Clayton branches/refactoring-email/plagger/Changes
r1773 r1906 1 1 The 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 2 60 3 61 == 0.7.14 (2006/10/17) == branches/refactoring-email/plagger/MANIFEST
r1773 r1906 3 3 assets/plugins/CustomFeed-Script/domain-expire.pl 4 4 assets/plugins/CustomFeed-Script/jsports-football.pl 5 assets/plugins/CustomFeed-Script/slims_calendar.pl 6 assets/plugins/CustomFeed-Script/ssl-expire.pl 5 7 assets/plugins/CustomFeed-Script/wowow-hv-51ch.pl 6 8 assets/plugins/CustomFeed-Script/wowow-liga-espanola.pl … … 15 17 assets/plugins/Filter-EntryFullText/ascii24_com.yaml 16 18 assets/plugins/Filter-EntryFullText/atmarkit.yaml 19 assets/plugins/Filter-EntryFullText/baltimoresun_com.yaml 17 20 assets/plugins/Filter-EntryFullText/barks.yaml 18 21 assets/plugins/Filter-EntryFullText/bbc.yaml … … 39 42 assets/plugins/Filter-EntryFullText/docs_info_apple_com.yaml 40 43 assets/plugins/Filter-EntryFullText/drecom.yaml 44 assets/plugins/Filter-EntryFullText/dsp_co_jp.yaml 41 45 assets/plugins/Filter-EntryFullText/eweek.yaml 42 46 assets/plugins/Filter-EntryFullText/extremetech.yaml 43 47 assets/plugins/Filter-EntryFullText/forbes.yaml 44 48 assets/plugins/Filter-EntryFullText/ft.yaml 49 assets/plugins/Filter-EntryFullText/gigazine_net.yaml 45 50 assets/plugins/Filter-EntryFullText/gyao_content.pl 46 51 assets/plugins/Filter-EntryFullText/hatena_diary.pl … … 70 75 assets/plugins/Filter-EntryFullText/matino-akari_com.yaml 71 76 assets/plugins/Filter-EntryFullText/memn0ck.yaml 77 assets/plugins/Filter-EntryFullText/mt2.pl 72 78 assets/plugins/Filter-EntryFullText/mtv-music.yaml 73 79 assets/plugins/Filter-EntryFullText/mycom_journal.yaml 74 80 assets/plugins/Filter-EntryFullText/netkeiba.yaml 81 assets/plugins/Filter-EntryFullText/news_3yen_com.yaml 75 82 assets/plugins/Filter-EntryFullText/news_com.yaml 76 83 assets/plugins/Filter-EntryFullText/news_livedoor_com.yaml 77 84 assets/plugins/Filter-EntryFullText/newsforge.yaml 85 assets/plugins/Filter-EntryFullText/nifty_com_usuta.yaml 78 86 assets/plugins/Filter-EntryFullText/nikkansports.yaml 79 87 assets/plugins/Filter-EntryFullText/nikkei.yaml … … 144 152 assets/plugins/Filter-StripRSSAd/plaza_rakuten.pat 145 153 assets/plugins/Filter-StripRSSAd/rssad_jp.pat 154 assets/plugins/Filter-StripRSSAd/rsscache.pat 146 155 assets/plugins/Filter-StripRSSAd/seesaa.pat 147 156 assets/plugins/Filter-StripRSSAd/valueclick.pat … … 229 238 deps/Filter-Babelfish.yaml 230 239 deps/Filter-BlogPet.yaml 240 deps/Filter-DegradeYouTube.yaml 231 241 deps/Filter-Delicious.yaml 232 242 deps/Filter-DeliciousFeedTags.yaml … … 322 332 deps/Subscription-XOXO.yaml 323 333 deps/Subscription-XPath.yaml 334 deps/Summary-AppleScript.yaml 324 335 deps/Summary-Auto.yaml 325 336 deps/Summary-English.yaml 337 deps/Summary-GetSen.yaml 326 338 deps/Summary-HatenaBookmark.yaml 339 deps/Summary-Japanese.yaml 327 340 deps/Summary-Simple.yaml 328 341 deps/Summary-TextOriginal.yaml … … 421 434 lib/Plagger/Plugin/Filter/BulkfeedsTerms.pm 422 435 lib/Plagger/Plugin/Filter/CompositeFeed.pm 436 lib/Plagger/Plugin/Filter/DegradeYouTube.pm 423 437 lib/Plagger/Plugin/Filter/Delicious.pm 424 438 lib/Plagger/Plugin/Filter/DeliciousFeedTags.pm … … 563 577 lib/Plagger/Plugin/Subscription/XOXO.pm 564 578 lib/Plagger/Plugin/Subscription/XPath.pm 579 lib/Plagger/Plugin/Summary/AppleScript.pm 565 580 lib/Plagger/Plugin/Summary/Auto.pm 566 581 lib/Plagger/Plugin/Summary/English.pm 582 lib/Plagger/Plugin/Summary/GetSen.pm 567 583 lib/Plagger/Plugin/Summary/HatenaBookmark.pm 584 lib/Plagger/Plugin/Summary/Japanese.pm 568 585 lib/Plagger/Plugin/Summary/Simple.pm 569 586 lib/Plagger/Plugin/Summary/TextOriginal.pm branches/refactoring-email/plagger/Makefile.PL
r1741 r1906 12 12 requires('YAML' => 0.39); 13 13 requires('Text::Tags'); 14 requires('DateTime' => 0.29); 14 requires('DateTime' => 0.35); 15 requires('DateTime::TimeZone' => 0.56); 16 requires('DateTime::Locale' => 0.32); 15 17 requires('DateTime::Format::Mail'); 16 18 requires('DateTime::Format::W3CDTF'); … … 45 47 'Better Encoding detection' => [ 46 48 -default => 0, 47 recommends('Encode::Detect' ),49 recommends('Encode::Detect', 1.0), 48 50 ], 49 51 'POD Testing' => [ … … 69 71 recommends('HTML::TreeBuilder'), 70 72 recommends('HTML::FormatText'), 73 ], 74 'Parse Japanese datetime format' => [ 75 -default => 0, 76 recommends('DateTime::Format::Japanese'), 71 77 ], 72 78 ); branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/pmachine.pl
r966 r1906 2 2 sub handle { 3 3 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; 5 5 } 6 6 7 7 sub extract { 8 8 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){ 10 10 my $body = $1; 11 11 return "<div>$body</div>"; branches/refactoring-email/plagger/assets/plugins/Filter-EntryFullText/slashdot_jp.yaml
r515 r1906 2 2 author: Tatsuhiko Miyagawa 3 3 handle: http://slashdot.jp/.*?article\.pl\? 4 extract: (<div class="intro text">.*?</div>).*?(<div class="bodytext">.*?</div>)?4 extract: (<div class="intro">.*?</div>).*?(<div class="bodytext">.*?</div>)? 5 5 extract_capture: body more 6 6 extract_after_hook: $data->{body} .= $data->{more} if $data->{more} branches/refactoring-email/plagger/assets/plugins/Filter-TruePermalink/2chrss.yaml
r612 r1906 2 2 match: http://rss\.s2ch\.net/ 3 3 rewrite: | 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 1 1 author: youpy 2 rewrite: s/[\?&;](?: ref|from|FM)=(?:atom|rss|rssall)([&;].*)?$/defined($1) ? $1 : ''/e2 rewrite: 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 16 16 <link rel="stylesheet" type="text/css" href="[% style | html %]" /> 17 17 [% END %] 18 <title>[% feed.title |html %]</title>18 <title>[% feed.title.html %]</title> 19 19 </head> 20 20 [% USE util = Plagger.Util -%] … … 24 24 <div id="banner"> 25 25 <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> 28 28 </div> 29 29 </div> … … 33 33 <div id="alpha-inner" class="pkg"> 34 34 [% 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 %]"> 37 37 <h3 class="entry-header"> 38 38 [% 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>: 40 40 [% END %] 41 <a href="[% (entry.permalink || entry.id) | html %]">[% entry.title |html %]</a>41 <a href="[% entry.permalink | html %]">[% entry.title.html %]</a> 42 42 </h3> 43 43 <div class="entry-content"> 44 44 [% 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 %] 45 45 <div class="entry-body"> 46 [% entry.body %]46 [% entry.body.html %] 47 47 <p class="entry-footer"> 48 48 <span class="post-footers">Posted … … 71 71 [% FOREACH member = members %] 72 72 <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> 74 74 </li> 75 75 [% END %] branches/refactoring-email/plagger/deps/CustomFeed-Mixi.yaml
r1206 r1906 2 2 author: Tatsuhiko Miyagawa 3 3 depends: 4 WWW::Mixi: 0.4 64 WWW::Mixi: 0.48 branches/refactoring-email/plagger/deps/Filter-GuessTimeZoneByDomain.yaml
r1791 r1906 2 2 author: Tatsuhiko Miyagawa 3 3 depends: 4 DateTime::TimeZone: 0.525 4 IP::Country: 0 branches/refactoring-email/plagger/deps/Summary-GetSen.yaml
r1777 r1906 3 3 depends: 4 4 XMLRPC::Lite: 0 5 bundles: 6 - Filter::GuessLanguage branches/refactoring-email/plagger/lib/Plagger.pm
r1773 r1906 1 1 package Plagger; 2 2 use strict; 3 our $VERSION = '0.7.1 4';3 our $VERSION = '0.7.16'; 4 4 5 5 use 5.8.1; … … 294 294 if (my $sub = $feed->aggregator) { 295 295 $sub->($self, { feed => $feed }); 296 $feed->aggregator(undef); # for cloning 296 297 } else { 297 298 my $ok = $self->run_hook_once('customfeed.handle', { feed => $feed }); branches/refactoring-email/plagger/lib/Plagger/Date.pm
r1749 r1906 27 27 sub parse_dwim { 28 28 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 } 29 41 30 42 require Date::Parse; branches/refactoring-email/plagger/lib/Plagger/Plugin.pm
r1734 r1906 154 154 } 155 155 156 # ignore .svn directories 157 $rule->or( 158 $rule->new->directory->name('.svn')->prune->discard, 159 $rule->new, 160 ); 161 156 162 # $rule isa File::Find::Rule 157 163 for my $file ($rule->in($self->assets_dir)) { branches/refactoring-email/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm
r1769 r1906 88 88 $feed->language($remote->language); 89 89 $feed->author(_u($remote->author)); 90 $feed->updated($remote->modified) ;90 $feed->updated($remote->modified) if defined $remote->modified; 91 91 92 92 Encode::_utf8_on($$xml_ref); branches/refactoring-email/plagger/lib/Plagger/Plugin/Bundle/Planet.pm
r1744 r1906 18 18 module => 'Filter::StripTagsFromTitle', 19 19 }); 20 21 eval { require HTML::Tidy }; 22 unless ($@) { 23 $context->load_plugin({ 24 module => 'Filter::HTMLTidy', 25 }); 26 } 20 27 21 28 $context->load_plugin({ … … 82 89 filename => 'atom.xml', 83 90 format => 'Atom', 91 taguri_base => URI->new($self->conf->{url})->host, 84 92 }, 85 93 }); … … 145 153 =item Filter::StripTagsFromTitle 146 154 155 =item Filter::HTMLTidy (if HTML::Tidy is available) 156 147 157 =item Filter::HTMLScrubber 148 158 branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Debug.pm
r1473 r1906 24 24 my ($self, $context, $args) = @_; 25 25 26 my $feed = Plagger::Feed->new;26 my $feed = $args->{feed}; 27 27 $feed->type('debug'); 28 28 for (keys %{$self->conf}) { 29 next if $_ eq 'entry' ;29 next if $_ eq 'entry' || $_ eq 'entries'; 30 30 $feed->$_($self->conf->{$_}); 31 31 } 32 32 33 for my $entry_conf (@{ $self->conf->{entry}}) {33 for my $entry_conf (@{ $self->conf->{entry} || $self->conf->{entries} || [] }) { 34 34 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 } 36 39 $feed->add_entry($entry); 37 40 38 41 # 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 ) { 40 46 my $enclosure = Plagger::Enclosure->new; 41 47 $enclosure->$_($enclosure_conf->{$_}) for keys %$enclosure_conf; 48 $enclosure->auto_set_type unless defined $enclosure->type; 42 49 $entry->add_enclosure($enclosure); 43 50 } branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Mailman.pm
r480 r1906 71 71 72 72 my @matches; 73 while ($content =~ m!<LI><A HREF="(\d+\.html)">(.*?)\n</A><A NAME="(\d+)"> </A>\n<I>(.*?)\n</I>! g) {74 push @matches,{73 while ($content =~ m!<LI><A HREF="(\d+\.html)">(.*?)\n</A><A NAME="(\d+)"> </A>\n<I>(.*?)\n</I>!sg) { 74 my $data = { 75 75 link => $1, 76 76 subject => $2, … … 78 78 from => $4, 79 79 }; 80 $data->{subject} =~ tr/\n//d; 81 push @matches, $data; 80 82 } 81 83 branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Mixi.pm
r1784 r1906 179 179 my $meth = $MAP->{$type}->{get_detail}; 180 180 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 } 181 185 $item; 182 186 }, … … 187 191 $body =~ s!(\r\n?|\n)!<br />!g; 188 192 for my $image (@{ $item->{images} }) { 189 # xxx this should be $entry->enclosures190 193 $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); 191 199 } 192 200 $entry->body($body); … … 203 211 204 212 $context->update->add($feed); 213 } 214 215 sub 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; 205 224 } 206 225 branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/MixiDiarySearch.pm
r992 r1906 58 58 <table BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=550> 59 59 <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> 61 61 <td BGCOLOR=#FDF9F2><font COLOR=#996600>名 前</font></td> 62 62 <td COLSPAN=2 BGCOLOR=#FFFFFF>(.*?) \(.*?\) branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/POP3.pm
r1172 r1906 67 67 $entry->title($email->header('Subject')); 68 68 $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 70 76 $entry->body($self->get_body($email)); 71 77 branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/Simple.pm
r1686 r1906 45 45 46 46 my $content = decode_content($res); 47 my $title = extract_title($content);48 47 49 48 my $feed = Plagger::Feed->new; 50 $feed->title($ title);49 $feed->title($args->{feed}->title || extract_title($content)); 51 50 $feed->link($url); 52 51 … … 63 62 next if !$text || $text eq '[IMG]'; 64 63 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}++; 67 66 68 67 my $entry = Plagger::Entry->new; 69 68 $entry->title($text); 70 $entry->link($ url);69 $entry->link($item_url); 71 70 $feed->add_entry($entry); 72 71 … … 84 83 my $entry = Plagger::Entry->new; 85 84 $entry->title($title); 86 $entry->link( $href);85 $entry->link(URI->new_abs($href, $url)); 87 86 $feed->add_entry($entry); 88 87 branches/refactoring-email/plagger/lib/Plagger/Plugin/CustomFeed/YouTube.pm
r1775 r1906 68 68 m!<div class="vtitle">! 69 69 and $title_flag = 1; 70 m!<a href="/watch\?v=([^"]+)" >(.+)</a>!70 m!<a href="/watch\?v=([^"]+)"[^>]+>(.+)</a>! 71 71 and do { 72 72 if($title_flag){ … … 76 76 } 77 77 }; 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" />! 79 80 and $data->{image}->{url} = $1; 81 # get description 80 82 m!<div class="vdesc">! 81 and $data->{description} = <$fh>; 83 and do { 84 <$fh>; 85 $data->{description} = <$fh>; 86 }; 87 # get tags 82 88 m!<div class="vtagLabel">Tags:</div>! 83 89 and $tag_flag = 1; 84 m!(<a href="/results\?search_ type=.*)!90 m!(<a href="/results\?search_query=.*)! 85 91 and do { 86 92 if($tag_flag){ … … 89 95 } 90 96 }; 91 m!profile\?user=([^"]+)! 97 # get author 98 m!From:</span> <a href="/user/[^>]+">([^<]+)</a>! 99 and $data->{author} = $1; 100 m/<!-- end vEntry -->/ 92 101 and do { 93 102 $context->log( info => 'Got ' . $data->{title}); 94 $data->{author} = $1;95 103 my $entry = Plagger::Entry->new; 96 104 $entry->title($data->{title}); … … 106 114 107 115 # 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){ 109 117 $entry->add_tag($1); 110 118 } … … 129 137 if ($video_url) { 130 138 my $video_id = ( $video_url =~ /video_id=(\w+)/ )[0]; 131 132 139 my $enclosure = Plagger::Enclosure->new; 133 140 $enclosure->url( URI->new($video_url) ); branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/2chRSSContent.pm
r1417 r1906 14 14 my($self, $context, $args) = @_; 15 15 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)?/\-/!; 17 17 18 18 my $body = $args->{entry}->body; branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/Babelfish.pm
r1741 r1906 52 52 }; 53 53 54 my $title = $args->{entry}->title ;54 my $title = $args->{entry}->title->data; 55 55 my $title_tr = $self->translate($translator, $title, $language); 56 56 unless (defined $title_tr) { … … 64 64 sleep 1; 65 65 66 my $body = $args->{entry}->body ;66 my $body = $args->{entry}->body->data; 67 67 my $body_tr = $self->translate($translator, $body, $language); 68 68 unless (defined $body_tr) { branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm
r1741 r1906 125 125 126 126 # use Last-Modified to populate entry date, even if handler doesn't find one 127 # TODO: make this a separate plugin 127 128 if ($res->last_modified && !$args->{entry}->date) { 128 129 $args->{entry}->date( Plagger::Date->from_epoch($res->last_modified) ); … … 131 132 my @plugins = $handler ? ($handler) : @{ $self->{plugins} }; 132 133 134 my $upgraded; 133 135 for my $plugin (@plugins) { 134 136 if ( $handler || $plugin->handle($args) ) { … … 157 159 } 158 160 159 return 1; 161 $upgraded++; 162 last; 160 163 } 161 164 } 162 165 } 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; 163 175 164 176 # failed to extract: store whole HTML if the config is on … … 247 259 my $data; 248 260 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 249 266 if ($self->{extract}) { 250 267 if (my @match = $args->{content} =~ /$self->{extract}/s) { … … 271 288 no warnings 'redefine'; 272 289 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; 274 293 } else { 275 294 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 93 93 94 94 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)'); 96 96 my $body = $self->{scrubber}->scrub( $args->{entry}->body ); 97 97 $args->{entry}->body($body); branches/refactoring-email/plagger/lib/Plagger/Plugin/Filter/HatenaDiaryKeywordUnlink.pm
r545 r1906 15 15 my $body = $args->{entry}->body; 16 16 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; 18 18 19 19 if ($count) { branches/refactoring-email/plagger/lib/Plagger/Plugin/Namespace/MediaRSS.pm
r1769 r1906 14 14 my($self, $context, $args) = @_; 15 15 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'; 20 21 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 } 27 28 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 } 34 36 } 35 37 branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Excel.pm
r1196 r1906 4 4 use base qw(Plagger::Plugin); 5 5 6 use Plagger::Util qw(strip_html);7 6 use Spreadsheet::WriteExcel; 8 7 … … 40 39 $worksheet->write($row, $col++, $entry->title); 41 40 $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}); 43 42 $row++; 44 43 } branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Feed.pm
r1741 r1906 6 6 use XML::Feed; 7 7 use XML::Feed::Entry; 8 use XML::Feed::RSS; # load explicitly to force LibXML 8 9 use XML::RSS::LibXML; 9 10 use File::Spec; … … 52 53 if $f->primary_author; 53 54 55 my $taguri_base = $self->conf->{taguri_base} || do { 56 require Sys::Hostname; 57 Sys::Hostname::hostname(); 58 }; 59 54 60 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? 56 62 } 57 63 … … 68 74 $entry->content($e->body); 69 75 } else { 70 $entry->{entry}->content($e->body );76 $entry->{entry}->content($e->body->utf8); 71 77 } 72 78 } 73 79 74 $entry->category(join(' ', @{$e->tags})) ;80 $entry->category(join(' ', @{$e->tags})) if @{$e->tags}; 75 81 $entry->issued($e->date) if $e->date; 76 82 $entry->modified($e->date) if $e->date; 77 83 78 $entry->author( $self->make_author($e->author, $feed_format) );79 84 if ($feed_format eq 'RSS') { 80 85 my $author = 'nobody@example.com'; … … 87 92 } 88 93 89 $entry->id("tag: plagger.org,2006:" . $e->id);94 $entry->id("tag:$taguri_base,2006:" . $e->id); 90 95 91 96 if ($e->has_enclosure) { … … 211 216 Whether to publish full content feed. Defaults to 1. 212 217 218 =item taguri_base 219 220 Domain name to use with Tag URI base for Atom feed IDs. If it's not 221 set, the domain is grabbed using Sys::Hostname module Optional. 222 213 223 =back 214 224 215 225 =head1 AUTHOR 216 226 227 Tatsuhiko Miyagawa 228 229 =head1 CONTRIBUTORS 230 217 231 Yoshiki Kurihara 218 232 219 Tatsuhiko Miyagawa220 221 233 Gosuke Miyashita 222 234 branches/refactoring-email/plagger/lib/Plagger/Plugin/Publish/Gmail.pm
r1792 r1906 107 107 Password => $route->{password}, 108 108 Port => $route->{port} || 587, 109 Timeout => $route->{timeout} || 300, 109 110 ]; 110 111 $msg->send_by_smtp_tls(@{ $self->{tls_args} }); branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/Bloglines.pm
r1734 r1906 66 66 my($self, $context) = @_; 67 67 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) { 71 76 my $feed = Plagger::Feed->new; 72 77 $feed->aggregator(sub { $self->sync(@_) }); … … 248 253 You can use this tags information using Rules in later phase. 249 254 255 =item dont_use_notifier_api 256 257 Turn it on when you want to skip Notifier API, which could sometimes 258 be broken and always returns 0 instead of the actual unread count. 259 250 260 =back 251 261 branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/Feed.pm
r861 r1906 5 5 use base qw( Plagger::Plugin ); 6 6 use Plagger::Util; 7 8 use XML::Feed; 7 use Plagger::FeedParser; 9 8 10 9 sub register { … … 30 29 31 30 my $content = Plagger::Util::load_uri($uri); 32 my $feed = eval { XML::Feed->parse(\$content) };31 my $feed = eval { Plagger::FeedParser->parse(\$content) }; 33 32 34 33 unless ($feed) { 35 $context->log( error => "Error loading feed $uri: " . ($@ || XML::Feed->errstr));34 $context->log( error => "Error loading feed $uri: $@" ); 36 35 return; 37 36 } branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/HatenaGroup.pm
r361 r1906 4 4 5 5 use URI; 6 use XML::Feed; 6 use Plagger::FeedParser; 7 use Plagger::UserAgent; 7 8 8 9 sub register { … … 23 24 my $feed_uri = "http://$group.g.hatena.ne.jp/diarylist?mode=rss"; 24 25 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: $@"); 26 29 for my $r ($remote->entries) { 27 30 $context->log(info => "diary: ". $r->link); branches/refactoring-email/plagger/lib/Plagger/Plugin/Subscription/LivedoorReader.pm
r1734 r1906 76 76 my $feed = Plagger::Feed->new; 77 77 $feed->type('livedoorReader'); 78 $feed->title( Plagger::Util::strip_html($data->{channel}->{title}));78 $feed->title($data->{channel}->{title}); 79 79 $feed->link($data->{channel}->{link}); 80 80 $feed->url($data->{channel}->{feedlink}); branches/refactoring-email/plagger/lib/Plagger/Plugin/Summary/Simple.pm
r1779 r1906 21 21 local $HTML::Tagset::isBodyElement{div} = 0; 22 22 my $html = $text->data; 23 while ($html =~ s|^\s*<( \w*)\s*[^>]*>(.*?)</\1>|$2|gs) {23 while ($html =~ s|^\s*<([^ >]+)(?:\s+[^>]+)?>(.*?)</\1>|$2|gs) { 24 24 if ($HTML::Tagset::isBodyElement{lc($1)}) { 25 25 return "<$1>$2</$1>"; branches/refactoring-email/plagger/lib/Plagger/Util.pm
r1741 r1906 215 215 216 216 sub safe_id { 217 my $id = shift;217 my $id = "$_[0]"; # force stringify 218 218 $id =~ s/^urn:guid://; 219 219 $id =~ /^([\w\-]+)$/ ? $1 : Digest::MD5::md5_hex($id); branches/refactoring-email/plagger/t/99-pod-spell.t
r1777 r1906 29 29 Anil 30 30 AtomPP 31 AppleScript 31 32 AutoLink 32 33 Babelfish … … 67 68 HatenaGroup 68 69 HatenaRSS 70 IDs 69 71 IE 70 72 IKC branches/refactoring-email/plagger/t/perlcriticrc
r1588 r1906 8 8 [TestingAndDebugging::ProhibitNoStrict] 9 9 allow = refs 10 11 # temporary disable this 12 [-Modules::RequireFilenameMatchesPackage] branches/refactoring-email/plagger/t/plugins/Bundle-Planet/bundle.t
r1483 r1906 45 45 file_contains("$main::dir/index.html", qr(href="http://planet.plagger.org/foafroll.xml")); 46 46 file_contains("$main::dir/atom.xml", qr!href="http://planet.plagger.org/"!); 47 file_contains("$main::dir/atom.xml", qr!tag:planet.plagger.org!); 47 48 file_contains("$main::dir/rss.xml", qr!<link>http://planet.plagger.org/</link>!); 48 49 file_contains("$main::dir/subscriptions.opml", qr!<head>\s*<title>Planet Foobar</title>!); branches/refactoring-email/plagger/t/plugins/CustomFeed-Debug/test.t
r1434 r1906 33 33 ok $context->update->feeds->[0]->entries->[1]->link; 34 34 ok $context->update->feeds->[0]->entries->[1]->body; 35 36 === Enclosures 37 --- input config 38 plugins: 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 61 is $context->update->feeds->[0]->link, 'http://localhost/'; 62 is $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 27 27 ok $context->update->feeds->[0]->entries->[0]->title; 28 28 ok $context->update->feeds->[0]->entries->[0]->link; 29 30 === Test custom feed title 31 --- input config 32 plugins: 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 44 is $context->update->feeds->[0]->link, 'http://sportsnavi.yahoo.co.jp/index.html'; 45 ok $context->update->feeds->[0]->count; 46 ok $context->update->feeds->[0]->entries->[0]->title; 47 ok $context->update->feeds->[0]->entries->[0]->link; 48 is $context->update->feeds->[0]->title, 'Sports navi custom!'; 49 branches/refactoring-email/plagger/t/plugins/Filter-Babelfish/babelfish.t
r1483 r1906 43 43 source: Japanese 44 44 destination: English 45 service: Google45 # service: Google 46 46 prepend_original: 0 47 47 --- expected … … 65 65 source: Japanese 66 66 destination: English 67 service: Google67 # service: Google 68 68 prepend_original: 1 69 69 --- expected … … 87 87 # source: Japanese 88 88 destination: English 89 service: Google89 # service: Google 90 90 prepend_original: 0 91 91 --- expected branches/refactoring-email/plagger/t/plugins/Filter-EntryFullText/slashdot.t
r1332 r1906 21 21 - title: Slashdot.jp 22 22 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 23 25 - module: Filter::EntryFullText 24 26 --- expected 25 27 ok $context->update->feeds->[0]->entries->[0]->body; 28 ok $context->update->feeds->[0]->entries->[1]->body; 26 29 branches/refactoring-email/plagger/t/plugins/Filter-HatenaDiaryKeywordUnlink/base.t
r1444 r1906 15 15 entry: 16 16 - 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> 18 18 - module: Filter::HatenaDiaryKeywordUnlink 19 19 --- expected 20 is $context->update->feeds->[0]->entries->[0]->body, "Plagger is a pluggable aggregator "20 is $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 4 4 use t::TestPlagger; 5 5 6 plan tests => 6;6 plan tests => 8; 7 7 run_eval_expected; 8 8 … … 20 20 - file://$t::TestPlagger::BaseDirURI/t/samples/monkey.rss 21 21 - file://$t::TestPlagger::BaseDirURI/t/samples/googlevideo.xml 22 - file://$t::TestPlagger::BaseDirURI/t/samples/flickr_new.xml 22 23 --- expected 23 24 my @feeds = $context->update->feeds; 24 25 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' ); 26 is $feeds[0]->entries->[0]->enclosures->[0]->url, 'http://youtube.com/v/MgldehkjK5k.swf'; 27 is $feeds[0]->entries->[0]->enclosures->[0]->type, 'application/x-shockwave-flash'; 28 is $feeds[0]->entries->[0]->icon->{url}, 'http://sjl-static4.sjl.youtube.com/vi/MgldehkjK5k/2.jpg'; 29 30 is $feeds[1]->entries->[0]->enclosures->[0]->type, 'video/mp4'; 31 is $feeds[1]->entries->[0]->enclosures->[1]->type, 'video/x-flv'; 32 is $feeds[1]->entries->[0]->icon->{url}, 'http://video.google.com/ThumbnailServer?app=vss&contentid=ac22092b58659308&second=5&itag=w320&urlcreated=1148908032&sigh=oxDLuV7bChBhYFMFSFamVpkIHHE'; 33 34 is $feeds[2]->entries->[0]->enclosures->[0]->type, 'image/jpeg'; 35 is $feeds[2]->entries->[0]->enclosures->[0]->url, 'http://static.flickr.com/109/313831333_60eb5e65b5_m.jpg'; 31 36 32 37 38 branches/refactoring-email/plagger/t/plugins/Publish-Feed/atom1.t
r1358 r1906 8 8 9 9 test_plugin_deps; 10 plan tests => 2;10 plan tests => 4; 11 11 run_eval_expected; 12 12 … … 34 34 is $feed->version, '1.0'; 35 35 is $feed->title, 'Bulknews::Subtech'; 36 unlike( ($feed->entries)[0]->content->as_xml, qr/CgkJPGRpdiBjbGFz/); 37 file_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 82 82 <p>First paragraph</p> 83 83 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 84 90 === I18N. Japanese plaintext 85 91 --- input
