Show
Ignore:
Timestamp:
10/21/04 19:53:13 (7 years ago)
Author:
earle
Message:

Apply Kake's description patch

Location:
cgi-wiki-plugin-rss-reader/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • cgi-wiki-plugin-rss-reader/trunk/CHANGES

    r202 r206  
     12004-10-21: 1.4 
     2            * Add descriptions to RSS items as per request from Kake Pugh. 
     3 
    142004-06-03: 1.3 
    25            * Fixed a bug with handling of RSS 2.0 GUIDs that was spotted by  
  • cgi-wiki-plugin-rss-reader/trunk/lib/CGI/Wiki/Plugin/RSS/Reader.pm

    r202 r206  
    55use vars qw( $VERSION @ISA ); 
    66 
    7 $VERSION = '1.3'; 
     7$VERSION = '1.4'; 
    88@ISA = qw(CGI::Wiki::Plugin); 
    99 
     
    105105 
    106106    push @rss_items, { 
    107                        title => $_->{title}, 
    108                        link  => $link 
     107                       title       => $_->{title},                              
     108                       link        => $link,                                    
     109                       description => $_->{description}, 
    109110                     }; 
    110111  } 
     
    156157 
    157158C<retrieve> will return an array of hashes, one for each item in the RSS 
    158 feed. The hashes contain two items, C<title> and C<link>. 
     159feed. The hashes contain three items, C<title>, C<link>, and C<description>.    
    159160 
    160161If the URL or file you specified cannot be retrieved/read, C<retrieve> will 
  • cgi-wiki-plugin-rss-reader/trunk/t/rss.t

    r202 r206  
    2626      <title>Example item 1</title> 
    2727      <link>http://example.com/1.html</link> 
     28      <description>The first example.</description>                             
    2829    </item> 
    2930    <item> 
    3031      <title>Example item 2</title> 
    3132      <link>http://example.com/2.html</link> 
     33      <description>The second example.</description>                            
    3234    </item> 
    3335    <item> 
    3436      <title>Example item 3</title> 
    3537      <link>http://example.com/3.html</link> 
     38      <description>The third example.</description>                             
    3639    </item> 
    3740  </channel> 
     
    4952package main; 
    5053 
    51 use Test::More tests => 7; 
     54use Test::More tests => 9; 
    5255 
    5356# Create a temporary file, fill it with the RSS we defined 
     
    7780is($items[0]{link}, 'http://example.com/1.html', 'Got local link'); 
    7881 
     82#5                                                                              
     83is($items[0]{description}, 'The first example.', 'Got local description');      
     84  
    7985$rss = CGI::Wiki::Plugin::RSS::Reader->new( 
    8086  url => 'http://example.com/example.rss', 
     
    8389@items = $rss->retrieve; 
    8490 
    85 #5 
     91#6 
    8692is($items[0]{title}, 'Example item 1', 'Got remote title'); 
    8793 
    88 #6 
     94#7 
    8995is($items[0]{link}, 'http://example.com/1.html', 'Got remote link'); 
     96 
     97#8                                                                              
     98is($items[0]{description}, 'The first example.', 'Got remote description'); 
    9099 
    91100my $died; 
     
    101110}; 
    102111 
    103 #7 
     112#9 
    104113is($died, 1, 'Caught illegal config options'); 
    105114