Changeset 856

Show
Ignore:
Timestamp:
05/30/06 15:14:41
Author:
miyagawa
Message:

merge from trunk to plagger-server for Enclosures support and such. Sorry for the big commit

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/feature-server/plagger/AUTHORS

    r599 r856  
    2424Daisuke Murase (typester) 
    2525Manabu Ishii 
     26woremacx 
     27Tatsuya Noda 
     28Motokazu Sekine (cheebow) 
  • branches/feature-server/plagger/Changes

    r655 r856  
    11The latest, HTML version of this document is always available at http://plagger.org/trac.cgi/wiki/PlaggerChangeLog 
     2 
     3== 0.7.1 (2006/05/24) == 
     4 
     5=== Core === 
     6 
     7 * Added woremacx, topia and cheebow as AUTHORS 
     8 * Plagger::Cookies and Plagger::Mechanize allows Plagger to share cookies with your browser like Firefox, IE or Safari. 
     9 
     10=== New Plugins === 
     11 
     12 * Notify::UpdatePing: notify updates via XMLRPC pings (miyagawa) 
     13 * Publish::PalmDoc: publish updates to PalmDoc (cheebow) 
     14 * Publish::OutlineText: publish updates as outline text (cheebow) 
     15 
     16=== Plugins Updates === 
     17 
     18 * Filter::Regexp: now you can use utf-8 regular expressions (woremacx) 
     19 * Widget::Delicious: Support one_click_post to automatically post by clicking (s_nobu) 
     20 * Filter::FetchEnclosures: Now it's extensible using meta-plugins. Added youtube.pl as an example. Thanks to mizzy 
     21 * CustomFeed::Simple: deduplicate links by URLs. Don't add links associated with images without alt (miyagawa) 
     22 * Filter::TruePermalink: Added YouTube, MSN Mainichi 
     23 * Publish::MT: Fixed blog_id config bug. #252 
     24 * Subscription::LivedoorReader: Adds ApiKey as a sticky query to their API (suggested by mala) 
     25 * Publish::Gmail: Don't trim lines over 1000 by using quoted-printable. 
     26 * CustomFeed::GoogleNews: now accepts keyword search result page as well 
     27 * Filter::HatenaRSS: Update OPML URL. Uses Cookie sharing framework. 
     28 * CustomFeed::Frepa: Uses Cookie sharing. 
     29 * CustomFeed::Mixi: Uses Cookie sharing. 
     30 * CustomFeed::Yahoo360JP: Uses Cookie sharing. 
     31 * Subscription::LivedoorReader: Uses Cookie sharing. 
     32 * Notify::Campfire: Uses Cookie sharing. 
     33 
     34== 0.7.0 (2006/05/17) == 
     35 
     36=== Core === 
     37 
     38 * Shiny new Enclosure support! 
     39 * Dependency for MIME::Types 
     40 * Fix $cache->path_to auto creation bug 
     41 * Allow plugins/Foo/Bar.pm directory strcuture to be backward compatible 
     42 * Added regression and plugins tests suite for the first time 
     43 
     44 
     45=== New Plugins === 
     46 
     47 * Filter::FetchEnclosure: Download enclosures automatically to local 
     48 * CustomFeed::YouTube: Search YouTube and find enclosures (mizzy) 
     49 * Filter::RewriteEnclosureURL: Rewrite enclosure's URL when you republish downloaded enclosures 
     50 * Filter::POPFile: Use POPFile XMLRPC API to classify feeds (charsbar) 
     51 * Filter::TagsToTitle: Add tags to title as prefixes (charsbar) 
     52 * Filter::FindEnclosures: Automatically discover enclosures in entry content 
     53 * Filter::HEADEnclosureMetadata: Send HEAD requests to enclosures to get Length and correct filename 
     54 * Subscription::XPath: extract subscriptions from XHTML using XPath (youpy) 
     55 * Subscription::PlanetINI: extract subscriptions from Planet's config.ini file 
     56 
     57=== Plugins Updates === 
     58 
     59 * Publish::2chdat: Internal fix to use id_safe method 
     60 * Subscription::Bloglines: support enclosures taken from sync API 
     61 * Publish::Gmail: Attach enclosures if they're downloaded locally with FetchEnclosure 
     62 * Filter::TruePermalink: Now supports rewriting enclosure URL as well. 
     63 * Filter::TruePermalink: Support recursive mode and redirector resolution 
     64 * Publish::Feed: Support enclosure creation in RSS 2.0 and Atom feeds 
     65 * Filter::SpamAssassin: Nuked some options (charsbar) 
     66 * Filter::HatenaKeyword: Use title to extract keywords as well 
     67 * Filter::StripRSSAd: Added pheedo.jp pattern. Now can strip entry if it contains certain pattern. 
     68 *  
     69== 0.6.6 (2006/05/12) == 
     70 
     71=== Core === 
     72 
     73 * Added sites upgrade files (woremacx) 
     74 * Don't truncate newline after password rewrite #200 
     75 * Share $feed object between subscription and update 
     76 * encode detection now uses XML encoding declaration first 
     77 * Unhandled feed is removed from $context->subscription 
     78 * Plagger::Date->parse doesn't force preference timezone if parsed datetime is floating 
     79 * Load plugins from plugins/*/lib #212 
     80 
     81=== New Plugins === 
     82  
     83 * Filter::HatenaKeywordTag: Use Hatena Keyword API to auto-tag (secondlife) 
     84 * Search::Estraier: Search plugin to use Hyper Estraier Node API (miyagawa) 
     85 * Subscription::XOXO: load subscription from XOXO microformats (miyagawa) 
     86 * Publish::2chdat: Create 2ch subject.txt and *.dat files (miyagawa) 
     87 * Filter::2chRSSContent: Fix rss.s2ch.net feed content (miyagawa) 
     88 * Filter::Markdown: Filter entry body using Markdown syntax (s_nobu)  
     89 
     90=== Plugins Updates === 
     91 
     92 * Notify::IRC: added password config to plagger-ircbot #197 
     93 * Filter::TruePermalink: Updated Y! Blogsearch pattern. Added reedit.com 
     94 * rename Publish::Spotlight to Search::Spotlight #207 
     95 * CustomFeed::Mixi: support "ashiato". Update WWW::Mixi deps 
     96 * Rule::URLBL: now works with $args->{entry} to be used with Filter::Rule 
     97 * Publish::Planet: get members from subscription rather than update #198 
     98 * CustomFeed::BloglinesCitation: Handle local datetime PST #187 
     99 * Filter::EntryFullText: now work with rule 
    2100 
    3101== 0.6.5 (2006/04/28) == 
  • branches/feature-server/plagger/MANIFEST

    r669 r856  
    1111assets/plugins/Filter-EntryFullText/blog_goo_ne_jp.yaml 
    1212assets/plugins/Filter-EntryFullText/blog_tech.rikunabi_next.yaml 
     13assets/plugins/Filter-EntryFullText/business-i.yaml 
    1314assets/plugins/Filter-EntryFullText/chugoku-np.yaml 
    1415assets/plugins/Filter-EntryFullText/chuspo_dragons.yaml 
     
    3132assets/plugins/Filter-EntryFullText/japan_linux_com.yaml 
    3233assets/plugins/Filter-EntryFullText/japan_zdnet_com.yaml 
     34assets/plugins/Filter-EntryFullText/kyodo.yaml 
    3335assets/plugins/Filter-EntryFullText/kyoko_shimbun_news.yaml 
     36assets/plugins/Filter-EntryFullText/kyoto-np.yaml 
    3437assets/plugins/Filter-EntryFullText/linuxjournal.yaml 
    3538assets/plugins/Filter-EntryFullText/livedoorblog.pl 
     39assets/plugins/Filter-EntryFullText/mainichi-msn.yaml 
     40assets/plugins/Filter-EntryFullText/mycom_journal.yaml 
    3641assets/plugins/Filter-EntryFullText/netkeiba.yaml 
    3742assets/plugins/Filter-EntryFullText/news_com.yaml 
    3843assets/plugins/Filter-EntryFullText/newsforge.yaml 
    3944assets/plugins/Filter-EntryFullText/nikkansports.yaml 
     45assets/plugins/Filter-EntryFullText/nikkei.yaml 
    4046assets/plugins/Filter-EntryFullText/nytimes.yaml 
     47assets/plugins/Filter-EntryFullText/okinawatimes_day.yaml 
    4148assets/plugins/Filter-EntryFullText/osaka_nikkansports.yaml 
    42 assets/plugins/Filter-EntryFullText/pcweb_mycom.yaml 
    4349assets/plugins/Filter-EntryFullText/physorg.yaml 
    4450assets/plugins/Filter-EntryFullText/plaza_rakuten.yaml 
     
    4652assets/plugins/Filter-EntryFullText/rbbtoday_com.yaml 
    4753assets/plugins/Filter-EntryFullText/reuters.yaml 
     54assets/plugins/Filter-EntryFullText/ryukyushimpo.yaml 
    4855assets/plugins/Filter-EntryFullText/sanspo.yaml 
    4956assets/plugins/Filter-EntryFullText/sciam.yaml 
    5057assets/plugins/Filter-EntryFullText/searchenginejournal.yaml 
    5158assets/plugins/Filter-EntryFullText/sixapart.pl 
     59assets/plugins/Filter-EntryFullText/slashcode.pl 
    5260assets/plugins/Filter-EntryFullText/slashdot_jp.yaml 
    5361assets/plugins/Filter-EntryFullText/sponichi.yaml 
     
    5664assets/plugins/Filter-EntryFullText/theinquirer.yaml 
    5765assets/plugins/Filter-EntryFullText/theregister.yaml 
     66assets/plugins/Filter-EntryFullText/ti-da_net.yaml 
    5867assets/plugins/Filter-EntryFullText/usatoday.yaml 
    5968assets/plugins/Filter-EntryFullText/wired_com.yaml 
     69assets/plugins/Filter-EntryFullText/worldtimes.yaml 
    6070assets/plugins/Filter-EntryFullText/www_nikkeibp.yaml 
    6171assets/plugins/Filter-EntryFullText/yakult.yaml 
    6272assets/plugins/Filter-EntryFullText/yomiuri.yaml 
     73assets/plugins/Filter-EntryFullText/youtube.yaml 
    6374assets/plugins/Filter-EntryFullText/zakzak.yaml 
    6475assets/plugins/Filter-EntryFullText/zzz_google_adsense.pl 
     76assets/plugins/Filter-FindEnclosures/youtube.pl 
    6577assets/plugins/Filter-StripRSSAd/feedburner 
    6678assets/plugins/Filter-StripRSSAd/google_adsense 
    6779assets/plugins/Filter-StripRSSAd/google_adsense2 
    6880assets/plugins/Filter-StripRSSAd/pheedo 
     81assets/plugins/Filter-StripRSSAd/pheedo_jp 
     82assets/plugins/Filter-StripRSSAd/pheedo_jp_ad_entry.yaml 
    6983assets/plugins/Filter-StripRSSAd/plaza_rakuten 
    7084assets/plugins/Filter-StripRSSAd/rssad_jp 
     
    7286assets/plugins/Filter-StripRSSAd/valueclick 
    7387assets/plugins/Filter-TruePermalink/2chrss.yaml 
     88assets/plugins/Filter-TruePermalink/cnet_podcast.yaml 
     89assets/plugins/Filter-TruePermalink/imenu.yaml 
     90assets/plugins/Filter-TruePermalink/msn-mainichi.yaml 
    7491assets/plugins/Filter-TruePermalink/namaan.yaml 
    7592assets/plugins/Filter-TruePermalink/rd_yahoo.yaml 
    7693assets/plugins/Filter-TruePermalink/reddit.yaml 
     94assets/plugins/Filter-TruePermalink/redirectors.yaml 
    7795assets/plugins/Filter-TruePermalink/refrss.yaml 
    7896assets/plugins/Filter-TruePermalink/tech_souken.yaml 
     
    8098assets/plugins/Filter-TruePermalink/yahoo_blog_search2.yaml 
    8199assets/plugins/Filter-TruePermalink/yahoo_us_rd.yaml 
     100assets/plugins/Filter-TruePermalink/youtube.yaml 
    82101assets/plugins/Notify-IRC/irc_notify.tt 
     102assets/plugins/Notify-Tiarra/irc_notify.tt 
    83103assets/plugins/Publish-CHTML/chtml_entry.tt 
    84104assets/plugins/Publish-CHTML/chtml_feed.tt 
     
    89109assets/plugins/Publish-MTWidget/mt_widget.tt 
    90110assets/plugins/Publish-OPML/opml.tt 
     111assets/plugins/Publish-PalmDoc/palmdoc.tt 
    91112assets/plugins/Publish-Planet/default/static/css/handheld.css 
    92113assets/plugins/Publish-Planet/default/static/css/print.css 
     
    104125bin/spotlight_comment.scpt 
    105126Changes 
    106 examples/aggregator.yaml 
    107127examples/atode.yaml 
    108128examples/bloglines2gmail.yaml 
     
    110130examples/livedoorreader2gmail.yaml 
    111131examples/planet.yaml 
     132examples/podcast.yaml 
     133examples/search.yaml 
     134examples/xoxo-planet.yaml 
     135examples/xoxo2opml.yaml 
     136examples/yapcvideo.yaml 
    112137inc/Module/AutoInstall.pm 
    113138inc/Module/Install.pm 
     
    127152lib/Plagger/Cache/Null.pm 
    128153lib/Plagger/CacheProxy.pm 
     154lib/Plagger/Cookies.pm 
    129155lib/Plagger/Crypt.pm 
    130156lib/Plagger/Crypt/Base64.pm 
    131157lib/Plagger/Date.pm 
     158lib/Plagger/Enclosure.pm 
    132159lib/Plagger/Entry.pm 
    133160lib/Plagger/Feed.pm 
     161lib/Plagger/Mechanize.pm 
    134162lib/Plagger/Operator.pm 
    135163lib/Plagger/Plugin.pm 
     
    152180lib/Plagger/Plugin/CustomFeed/SVNLog.pm 
    153181lib/Plagger/Plugin/CustomFeed/Yahoo360JP.pm 
     182lib/Plagger/Plugin/CustomFeed/YouTube.pm 
    154183lib/Plagger/Plugin/Filter/2chNewsokuTitle.pm 
     184lib/Plagger/Plugin/Filter/2chRSSContent.pm 
    155185lib/Plagger/Plugin/Filter/2chRSSPermalink.pm 
    156186lib/Plagger/Plugin/Filter/AtomLinkRelated.pm 
     
    167197lib/Plagger/Plugin/Filter/FeedBurnerPermalink.pm 
    168198lib/Plagger/Plugin/Filter/FeedFlareStripper.pm 
     199lib/Plagger/Plugin/Filter/FetchEnclosure.pm 
     200lib/Plagger/Plugin/Filter/FindEnclosures.pm 
    169201lib/Plagger/Plugin/Filter/FloatingDateTime.pm 
    170202lib/Plagger/Plugin/Filter/HatenaBookmarkTag.pm 
     
    173205lib/Plagger/Plugin/Filter/HatenaDiaryKeywordUnlink.pm 
    174206lib/Plagger/Plugin/Filter/HatenaFormat.pm 
     207lib/Plagger/Plugin/Filter/HatenaKeywordTag.pm 
     208lib/Plagger/Plugin/Filter/HEADEnclosureMetadata.pm 
    175209lib/Plagger/Plugin/Filter/ImageInfo.pm 
     210lib/Plagger/Plugin/Filter/Markdown.pm 
    176211lib/Plagger/Plugin/Filter/NamaanPermalink.pm 
    177212lib/Plagger/Plugin/Filter/Pipe.pm 
     213lib/Plagger/Plugin/Filter/POPFile.pm 
    178214lib/Plagger/Plugin/Filter/Profanity.pm 
    179215lib/Plagger/Plugin/Filter/Regexp.pm 
    180216lib/Plagger/Plugin/Filter/ResolveRelativeLink.pm 
     217lib/Plagger/Plugin/Filter/RewriteEnclosureURL.pm 
    181218lib/Plagger/Plugin/Filter/Romanize.pm 
    182219lib/Plagger/Plugin/Filter/Romanize/Japanese.pm 
     
    186223lib/Plagger/Plugin/Filter/SpamAssassin.pm 
    187224lib/Plagger/Plugin/Filter/StripRSSAd.pm 
     225lib/Plagger/Plugin/Filter/TagsToTitle.pm 
    188226lib/Plagger/Plugin/Filter/tDiaryComment.pm 
    189227lib/Plagger/Plugin/Filter/Thumbnail.pm 
     
    202240lib/Plagger/Plugin/Notify/MSAgent.pm 
    203241lib/Plagger/Plugin/Notify/SSTP.pm 
     242lib/Plagger/Plugin/Notify/Tiarra.pm 
     243lib/Plagger/Plugin/Notify/UpdatePing.pm 
     244lib/Plagger/Plugin/Publish/2chdat.pm 
    204245lib/Plagger/Plugin/Publish/CHTML.pm 
    205246lib/Plagger/Plugin/Publish/CSV.pm 
     
    215256lib/Plagger/Plugin/Publish/MTWidget.pm 
    216257lib/Plagger/Plugin/Publish/OPML.pm 
     258lib/Plagger/Plugin/Publish/OutlineText.pm 
     259lib/Plagger/Plugin/Publish/PalmDoc.pm 
    217260lib/Plagger/Plugin/Publish/PDF.pm 
    218261lib/Plagger/Plugin/Publish/Pipe.pm 
     
    224267lib/Plagger/Plugin/Publish/Speech/Win32.pm 
    225268lib/Plagger/Plugin/Publish/Takahashi.pm 
     269lib/Plagger/Plugin/Search/Estraier.pm 
    226270lib/Plagger/Plugin/Search/Namazu.pm 
    227271lib/Plagger/Plugin/Search/Rast.pm 
     
    240284lib/Plagger/Plugin/Subscription/PingServer.pm 
    241285lib/Plagger/Plugin/Subscription/Planet.pm 
     286lib/Plagger/Plugin/Subscription/PlanetINI.pm 
     287lib/Plagger/Plugin/Subscription/XOXO.pm 
     288lib/Plagger/Plugin/Subscription/XPath.pm 
    242289lib/Plagger/Plugin/Widget/BloglinesSubscription.pm 
    243290lib/Plagger/Plugin/Widget/BulkfeedsSpamReport.pm 
  • branches/feature-server/plagger/MANIFEST.SKIP

    r669 r856  
    1616\.bak$ 
    1717\.orig$ 
     18plugins/.*\.pm$ 
     19tools/release\.pl 
     20t/plugins 
     21t/regression 
     22^# 
  • branches/feature-server/plagger/Makefile.PL

    r692 r856  
    2323requires('HTML::ResolveLink'); 
    2424requires('Date::Parse'); 
     25requires('MIME::Types', 1.16); 
    2526 
    2627build_requires(Test::More => 0.42); 
     
    3637        recommends('Test::Pod::Coverage'), 
    3738    ], 
     39    'Cookie sharing with Firefox' => [ 
     40        -default => 0, 
     41        recommends('HTTP::Cookies::Mozilla'), 
     42    ], 
     43); 
     44 
     45features( 
    3846    'Subscription::Bloglines' => [ 
    3947        -default => 1, 
    4048        recommends('WebService::Bloglines', 0.11), 
    41         recommends('XML::Liberal', 0.06), 
     49        recommends('XML::Liberal', 0.09), 
    4250    ], 
    4351    'Subscription::OPML' => [ 
     
    4957        recommends('XML::Feed', 0.08), 
    5058        recommends('XML::Atom'), 
    51         recommends('XML::RSS::LibXML', 0.19), 
     59        recommends('XML::RSS::LibXML', 0.20), 
    5260        recommends('XML::RSS::Liberal'), 
    5361    ], 
     
    214222        recommends('DateTime::Locale'), 
    215223    ], 
     224    'Subscription::PlanetINI' => [ 
     225        -default => 0, 
     226        recommends('Config::INI::Simple'), 
     227    ], 
     228    'Notify::UpdatePing' => [ 
     229        -default => 0, 
     230        recommends('XMLRPC::Lite'), 
     231    ], 
     232    'Publish::PalmDoc' => [ 
     233        -default => 0, 
     234        recommends('Palm::PalmDoc'), 
     235    ], 
    216236); 
    217237 
    218238if ($^O eq 'darwin') { 
    219239    features( 
     240        'Cookie sharing with Safari' => [ 
     241            -default => 0, 
     242            recommends('HTTP::Cookies::Safari'), 
     243        ], 
    220244        'Search::Spotlight' => [ 
    221245            -default => 1, 
    222246            recommends('Mac::Glue'), 
    223247        ], 
    224     ); 
    225     features( 
    226248        'Publish::Speech' => [ 
    227249            -default => 0, 
     
    234256} elsif ($^O eq 'MSWin32') { 
    235257    features( 
     258        'Cookie sharing with MSIE' => [ 
     259            -default => 0, 
     260            recommends('HTTP::Cookies::Microsoft'), 
     261        ], 
    236262        'Publish::Speech' => [ 
    237263            -default => 0, 
     
    247273    ); 
    248274} 
     275 
     276tests 't/*.t t/*/*.t t/*/*/*.t'; 
    249277 
    250278auto_include; 
  • branches/feature-server/plagger/assets/plugins/Filter-EntryFullText/impress.yaml

    r651 r856  
    11author: kazeburo 
    2 handle: http://\w+\.watch\.impress\.co\.jp/ 
     2handle: http://(\w+\.watch|k-tai)\.impress\.co\.jp/ 
    33extract: <!--\s?本文開始\s?-->(.*)<!--\s?本文終了\s?--> 
    44extract_capture: body 
  • branches/feature-server/plagger/assets/plugins/Filter-EntryFullText/itmedia.yaml

    r586 r856  
    11author: manabou 
    2 handle: http://www\.itmedia\.co\.jp/news/articles 
    3 extract: <div class="newart">.*?<h1>(.*?)</h1>.*?<!--BODY-->(.*?)<!--BODYEND--> 
    4 extract_capture: title body 
     2handle: http://(\w+)\.itmedia\.co\.jp/(\w+)/articles 
     3extract: <div class="newart">.*?(?:<div id="update">(\d{4}年\d\d月\d\d日 \d\d時\d\d分) 更新</div>)?.*?<h1>(.*?)</h1>\s*<h5>(.*?)</h5>\s*(?:<div id="update">(\d{4}年\d\d月\d\d日 \d\d時\d\d分) 更新</div>)?.*?<!--BODY-->(.*?)<!--BODYEND--> 
     4extract_capture: date1 title summary date2 body 
     5extract_after_hook: $data->{date} = $data->{date1} || $data->{date2} 
     6extract_date_format: %Y年%m月%d日 %H時%M分 
  • branches/feature-server/plagger/assets/plugins/Filter-EntryFullText/mycom_journal.yaml

    r694 r856  
    1 # upgrade http://pcweb.mycom.co.jp/haishin/rss/index.rdf 
     1# upgrade http://journal.mycom.co.jp/haishin/rss/index.rdf 
    22author: Nobuhito Sato 
    33handle: http://journal\.mycom\.co\.jp/ 
  • branches/feature-server/plagger/assets/plugins/Filter-EntryFullText/nikkansports.yaml

    r559 r856  
    99  - %Y年%m月%d日%H時%M分 
    1010  - %Y/%m/%d %H:%M 
    11  
     11extract_date_timezone: Asia/Tokyo 
  • branches/feature-server/plagger/assets/plugins/Filter-TruePermalink/yahoo_blog_search.yaml

    r612 r856  
    11author: Tatsuhiko Miyagawa 
    22match: http://rd\.yahoo\.co\.jp/rss/l/blogsearch 
    3 rewrite: s!^http://rd\.yahoo\.co\.jp/rss/l/blogsearch/search/\*!
     3rewrite: s!^http://rd\.yahoo\.co\.jp/rss/l/blogsearch/search/.*?\*\-http%3A!http:
    44 
  • branches/feature-server/plagger/examples/bloglines2gmail.yaml

    r402 r856  
    22  plugin_path: 
    33    - /home/miyagawa/plagger/plugins 
    4   #template_path: /home/miyagawa/plagger/template
     4  assets_path: /home/miyagawa/plagger/asset
    55  timezone: Asia/Tokyo 
    66  log: 
  • branches/feature-server/plagger/examples/livedoorreader2gmail.yaml

    r626 r856  
    22  plugin_path: 
    33    - /home/miyagawa/plagger/plugins 
    4   #assets_path: /home/miyagawa/plagger/assets 
     4  assets_path: /home/miyagawa/plagger/assets 
    55  timezone: Asia/Tokyo 
    66  log: 
  • branches/feature-server/plagger/lib/Plagger.pm

    r693 r856  
    11package Plagger; 
    22use strict; 
    3 our $VERSION = '0.6.5'; 
     3our $VERSION = '0.7.1'; 
    44 
    55use 5.8.1; 
     
    4141    if (-e $opt{config} && -r _) { 
    4242        $config = YAML::LoadFile($opt{config}); 
    43         $self->load_include($config); 
    44         $self->{conf} = $config->{global}; 
    45         $self->{conf}->{log} ||= { level => 'debug' }; 
    4643        $self->{config_path} = $opt{config}; 
     44    } elsif (ref($opt{config}) && ref($opt{config}) eq 'SCALAR') { 
     45        $config = YAML::Load(${$opt{config}}); 
     46    } elsif (ref($opt{config}) && ref($opt{config}) eq 'HASH') { 
     47        $config = $opt{config}; 
    4748    } else { 
    4849        croak "Plagger->bootstrap: $opt{config}: $!"; 
    4950    } 
    5051 
     52    $self->load_include($config); 
     53    $self->{conf} = $config->{global}; 
     54    $self->{conf}->{log} ||= { level => 'debug' }; 
     55 
     56    no warnings 'redefine'; 
    5157    local *Plagger::context = sub { $self }; 
    5258 
     
    6571sub rewrite_config { 
    6672    my $self = shift; 
     73 
     74    unless ($self->{config_path}) { 
     75        $self->log(warn => "config is not loaded from file. Ignoring rewrite tasks."); 
     76        return; 
     77    } 
    6778 
    6879    open my $fh, $self->{config_path} or $self->error("$self->{config_path}: $!"); 
     
    136147 
    137148    # use config filename as a base directory for cache 
    138     my $base = ( basename($config) =~ /^(.*?)\.yaml$/ )[0]
     149    my $base = ( basename($config) =~ /^(.*?)\.yaml$/ )[0] || 'config'
    139150    my $dir  = $base eq 'config' ? ".plagger" : ".plagger-$base"; 
    140151 
     
    159170                $ent = File::Spec->catfile($path, $ent); 
    160171                if (-f $ent && $ent =~ /\.pm$/) { 
    161                     my $pkg = $self->extract_package($ent) 
    162                         or die "Can't find package from $ent"; 
    163                     (my $base = $ent) =~ s!^$path/!!; 
    164                     $self->plugins_path->{$pkg} = $ent; 
     172                    $self->add_plugin_path($ent); 
    165173                } elsif (-d $ent) { 
    166174                    my $lib = File::Spec->catfile($ent, "lib"); 
     
    168176                        $self->log(debug => "Add $lib to INC path"); 
    169177                        unshift @INC, $lib; 
     178                    } else { 
     179                        my $rule = File::Find::Rule->new; 
     180                           $rule->file; 
     181                           $rule->name('*.pm'); 
     182                        my @modules = $rule->in($ent); 
     183                        for my $module (@modules) { 
     184                            $self->add_plugin_path($module); 
     185                        } 
    170186                    } 
    171187                } 
     
    177193        $self->load_plugin($plugin) unless $plugin->{disable}; 
    178194    } 
     195} 
     196 
     197sub add_plugin_path { 
     198    my($self, $file) = @_; 
     199 
     200    my $pkg = $self->extract_package($file) 
     201        or die "Can't find package from $file"; 
     202    $self->plugins_path->{$pkg} = $file; 
     203    $self->log(debug => "$file is added as a path to plugin $pkg"); 
    179204} 
    180205 
     
    220245    $module = "Plagger::Plugin::$module"; 
    221246 
    222     if (my $path = $self->plugins_path->{$module}) { 
     247    if ($module->isa('Plagger::Plugin')) { 
     248        $self->log(debug => "$module is loaded elsewhere ... maybe .t script?"); 
     249    } elsif (my $path = $self->plugins_path->{$module}) { 
    223250        eval { require $path } or die $@; 
    224251    } else { 
  • branches/feature-server/plagger/lib/Plagger/Cache.pm

    r590 r856  
    3636    if (@path > 1) { 
    3737        my @chunk = @path[0..$#path-1]; 
    38         mkpath(File::Spec->catfile(@chunk), 0, 0700); 
     38        mkpath(File::Spec->catfile($self->{base}, @chunk), 0, 0700); 
    3939    } 
    4040    File::Spec->catfile($self->{base}, @path); 
  • branches/feature-server/plagger/lib/Plagger/Entry.pm

    r384 r856  
    1717        tags    => [], 
    1818        meta    => {}, 
     19        enclosures => [], 
    1920    }, $class; 
    2021} 
     
    6970} 
    7071 
     72sub add_enclosure { 
     73    my($self, $enclosure) = @_; 
     74 
     75    # don't add enclosure with the same URL again and again 
     76    unless ($enclosure->url && grep { $_->url && $_->url eq $enclosure->url } $self->enclosures) { 
     77        push @{ $self->{enclosures} }, $enclosure; 
     78    } 
     79} 
     80 
     81sub enclosure { 
     82    my $self = shift; 
     83    wantarray ? @{$self->{enclosures}} : $self->{enclosures}->[0]; 
     84} 
     85 
     86sub enclosures { 
     87    my $self = shift; 
     88    wantarray ? @{$self->{enclosures}} : $self->{enclosures}; 
     89} 
     90 
     91sub has_enclosure { 
     92    my $self = shift; 
     93    scalar @{$self->{enclosures}} > 0; 
     94} 
     95 
    71961; 
    7297 
  • branches/feature-server/plagger/lib/Plagger/Feed.pm

    r455 r856  
    5555} 
    5656 
     57sub id_safe { 
     58    my $self = shift; 
     59    my $id = $self->id; 
     60    $id =~ s![^\w\s]+!_!g; 
     61    $id =~ s!\s+!_!g; 
     62    $id; 
     63} 
     64 
    5765sub title_text { 
    5866    my $self = shift; 
  • branches/feature-server/plagger/lib/Plagger/Plugin.pm

    r593 r856  
    55__PACKAGE__->mk_accessors( qw(conf rule rule_hook cache) ); 
    66 
     7use Plagger::Cookies; 
    78use Plagger::Crypt; 
    89use Plagger::Rule; 
     
    114115} 
    115116 
     117sub cookie_jar { 
     118    my $self = shift; 
     119 
     120    my $agent_conf = Plagger->context->conf->{user_agent} || {}; 
     121    if ($agent_conf->{cookies}) { 
     122        return Plagger::Cookies->create($agent_conf->{cookies}); 
     123    } 
     124 
     125    return $self->cache->cookie_jar; 
     126} 
     127 
    1161281; 
  • branches/feature-server/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm

    r680 r856  
    44 
    55use Feed::Find; 
     6use Plagger::Enclosure; 
    67use Plagger::UserAgent; 
    78use List::Util qw(first); 
     
    1213 
    1314$XML::Feed::RSS::PREFERRED_PARSER = first { $_->require } qw( XML::RSS::Liberal XML::RSS::LibXML XML::RSS ); 
     15 
     16eval { require XML::Liberal }; 
     17if (!$@ && XML::Liberal->can('globally_override')) { 
     18    XML::Liberal->globally_override('LibXML'); 
     19} 
    1420 
    1521sub register { 
     
    8793    unless ($remote) { 
    8894        $context->log(error => "Parsing $url failed. " . ($@ || XML::Feed->errstr)); 
    89         next
     95        return
    9096    } 
    9197 
     
    137143        $entry-