Changeset 525

Show
Ignore:
Timestamp:
04/03/06 18:53:15
Author:
miyagawa
Message:
  • Auto-add if handle starts with (to avoid YAML escapes)
  • decode YAML data as utf-8
  • Added nikkansports.yaml
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r522 r525  
    162162 
    163163package Plagger::Plugin::Filter::EntryFullText::YAML; 
     164use Encode; 
     165 
    164166sub new { 
    165167    my($class, $data, $base) = @_; 
     168 
     169    # add ^ if handle method starts with http:// 
     170    for my $key ( qw(custom_feed_handle handle handle_force) ) { 
     171        $data->{$key} = "^$data->{$key}" if $data->{$key} =~ m!^https?://!; 
     172    } 
     173 
     174    # decode as UTF-8 
     175    for my $key ( qw(extract extract_date_format) ) { 
     176        $data->{$key} = decode("UTF-8", $data->{$key}); 
     177    } 
     178 
    166179    bless {%$data, base => $base }, $class; 
    167180}