Changeset 348 for trunk/lib/OpenGuides/Utils.pm
- Timestamp:
- 05/07/04 18:01:35 (5 years ago)
- Files:
-
- 1 modified
-
trunk/lib/OpenGuides/Utils.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/OpenGuides/Utils.pm
r347 r348 113 113 return qq(<a href="$script_name?action=index;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>); 114 114 }, 115 qr/\@RSS _FEED\s+\[(.*?)\]/ => sub {116 # Get the URL. It's already been formatted into a117 # 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; 121 121 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; 125 125 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; 128 128 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 } 139 139 ); 140 140
