Changeset 348

Show
Ignore:
Timestamp:
05/07/04 18:01:35 (5 years ago)
Author:
earle
Message:

require CGI::Wiki::Plugin::RSS::Reader 1.2, also simply RSS macro name

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r347 r348  
    226226        'CGI::Wiki::Plugin::Locator::UK'  => '0.06', 
    227227        'CGI::Wiki::Plugin::RSS::ModWiki' => '0.02', 
    228         'CGI::Wiki::Plugin::RSS::Reader'  => 0, 
     228        'CGI::Wiki::Plugin::RSS::Reader'  => '1.2',  # earlier versions don't support RSS 2.0 
    229229        'Config::Tiny'                    => 0, 
    230230        'Data::Dumper'                    => 0, 
  • trunk/Changes

    r347 r348  
    33          pages, using CGI::Wiki::Plugin::RSS::Reader. This allows you 
    44          to do this to produce a list of up to ten hyperlinks: 
    5             @RSS_FEED [http://example.com/example.rss] 
     5            @RSS [http://example.com/example.rss] 
    66        
    77        Numerous template tweaks to comply with the W3C's Web Content  
  • trunk/PREREQUISITES

    r347 r348  
    1313CGI::Wiki::Plugin::Locator::UK (version 0.06 or later) 
    1414CGI::Wiki::Plugin::RSS::ModWiki (version 0.02 or later) 
    15 CGI::Wiki::Plugin::RSS::Reader 
     15CGI::Wiki::Plugin::RSS::Reader (version 1.2 or later) 
    1616Config::Tiny 
    1717Data::Dumper 
  • trunk/lib/OpenGuides/Utils.pm

    r347 r348  
    113113                  return qq(<a href="$script_name?action=index;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>); 
    114114                }, 
    115         qr/\@RSS_FEED\s+\[(.*?)\]/ => sub {  
    116                                             # Get the URL. It's already been formatted into a  
    117                                             # hyperlink so we need to reverse that. 
    118                                             my $url_raw = $_[0]; 
    119                                             $url_raw =~ />(.*?)</; 
    120                                             my $url = $1; 
     115        qr/\@RSS\s+\[(.*?)\]/ => sub {  
     116                                      # Get the URL. It's already been formatted into a  
     117                                      # hyperlink so we need to reverse that. 
     118                                      my $url_raw = $_[0]; 
     119                                      $url_raw =~ />(.*?)</; 
     120                                      my $url = $1; 
    121121 
    122                                             # Retrieve the RSS from the given URL. 
    123                                             my $rss = CGI::Wiki::Plugin::RSS::Reader->new(url => $url); 
    124                                             my @items = $rss->retrieve; 
     122                                      # Retrieve the RSS from the given URL. 
     123                                      my $rss = CGI::Wiki::Plugin::RSS::Reader->new(url => $url); 
     124                                      my @items = $rss->retrieve; 
    125125 
    126                                             # Ten items only at this till. 
    127                                             $#items = 10 if $#items > 10; 
     126                                      # Ten items only at this till. 
     127                                      $#items = 10 if $#items > 10; 
    128128 
    129                                             # Make an HTML list with them. 
    130                                             my $list = "<ul>\n"; 
    131                                             foreach (@items) 
    132                                             { 
    133                                               $list .= qq{\t<li><a href="} . $_->{link} . qq{">} . $_->{title} . "</a></li>\n"; 
    134                                             } 
    135                                             $list .= "</ul>\n"; 
    136  
    137                                             return $list; 
    138                                           } 
     129                                      # Make an HTML list with them. 
     130                                      my $list = "<ul>\n"; 
     131                                      foreach (@items) 
     132                                      { 
     133                                        my $link  = $_->{link}; 
     134                                        my $title = $_->{title}; 
     135                                        $list .= qq{\t<li><a href="$link">$title</a></li>\n}; 
     136                                      } 
     137                                      $list .= "</ul>\n"; 
     138                                    } 
    139139    ); 
    140140