Changeset 347
- Timestamp:
- 05/06/04 18:15:35 (5 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
Build.PL (modified) (1 diff)
-
Changes (modified) (1 diff)
-
PREREQUISITES (modified) (3 diffs)
-
lib/OpenGuides/Utils.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Build.PL
r336 r347 215 215 license => "perl", 216 216 requires => { 217 'Algorithm::Diff' => '0.13', # for sdiff218 'CGI' => '2.42', # unescape not in early versions, Dom says use this219 'CGI::Carp' => 0,220 'CGI::Cookie' => 0,221 'CGI::Wiki' => '0.49',222 'CGI::Wiki::Formatter::UseMod' => '0.09',223 'CGI::Wiki::Plugin::Categoriser' => 0,224 'CGI::Wiki::Plugin::Diff' => 0,225 'CGI::Wiki::Plugin::GeoCache' => 0,226 'CGI::Wiki::Plugin::Locator::UK' => '0.06',217 'Algorithm::Diff' => '0.13', # for sdiff 218 'CGI' => '2.42', # unescape not in early versions, Dom says use this 219 'CGI::Carp' => 0, 220 'CGI::Cookie' => 0, 221 'CGI::Wiki' => '0.49', 222 'CGI::Wiki::Formatter::UseMod' => '0.09', 223 'CGI::Wiki::Plugin::Categoriser' => 0, 224 'CGI::Wiki::Plugin::Diff' => 0, 225 'CGI::Wiki::Plugin::GeoCache' => 0, 226 'CGI::Wiki::Plugin::Locator::UK' => '0.06', 227 227 'CGI::Wiki::Plugin::RSS::ModWiki' => '0.02', 228 'Config::Tiny' => 0, 229 'Data::Dumper' => 0, 230 $drivers{$dbtype} => 0, 231 'File::Spec::Functions' => 0, 232 'Geography::NationalGrid' => 0, 233 'Parse::RecDescent' => 0, 234 'Search::InvertedIndex' => 0, 235 'Template' => 0, 236 'Test::MockObject' => '0.07', # earlier doesn't use 'mock' 237 'Time::Piece' => 0, 238 'URI::Escape' => 0, 228 'CGI::Wiki::Plugin::RSS::Reader' => 0, 229 'Config::Tiny' => 0, 230 'Data::Dumper' => 0, 231 $drivers{$dbtype} => 0, 232 'File::Spec::Functions' => 0, 233 'Geography::NationalGrid' => 0, 234 'LWP::Simple' => 0, 235 'Parse::RecDescent' => 0, 236 'Search::InvertedIndex' => 0, 237 'Template' => 0, 238 'Test::MockObject' => '0.07', # earlier doesn't use 'mock' 239 'Time::Piece' => 0, 240 'URI::Escape' => 0, 241 'XML::RSS' => 0, 239 242 }, 240 243 build_requires => { -
trunk/Changes
r345 r347 1 1 0.31 2 Created a new macro to allow the embedding of RSS feeds into 3 pages, using CGI::Wiki::Plugin::RSS::Reader. This allows you 4 to do this to produce a list of up to ten hyperlinks: 5 @RSS_FEED [http://example.com/example.rss] 2 6 3 7 Numerous template tweaks to comply with the W3C's Web Content -
trunk/PREREQUISITES
r317 r347 13 13 CGI::Wiki::Plugin::Locator::UK (version 0.06 or later) 14 14 CGI::Wiki::Plugin::RSS::ModWiki (version 0.02 or later) 15 CGI::Wiki::Plugin::RSS::Reader 15 16 Config::Tiny 16 17 Data::Dumper … … 24 25 File::Spec::Functions 25 26 Geography::NationalGrid 27 LWP::Simple 26 28 Module::Build (version 0.18 or later) 27 29 Parse::RecDescent … … 31 33 Time::Piece 32 34 URI::Escape 35 XML::RSS -
trunk/lib/OpenGuides/Utils.pm
r344 r347 5 5 $VERSION = '0.06'; 6 6 7 use lib '/home/earle/lib'; 7 8 use Carp qw( croak ); 8 9 use CGI::Wiki; 9 10 use CGI::Wiki::Formatter::UseMod; 11 use CGI::Wiki::Plugin::RSS::Reader; 10 12 use CGI::Wiki::Search::SII; 11 13 use Search::InvertedIndex::DB::DB_File_SplitHash; … … 107 109 qq(<form action="$search_url" method="get"><input type="text" size="20" name="search"><input type="submit" name="Go" value="Search"></form>), 108 110 qr/\@INDEX_LINK\s+\[\[(Category|Locale)\s+([^\]|]+)\|?([^\]]+)?\]\]/ => 109 sub { my $link_title = $_[2] || "View all pages in $_[0] $_[1]"; return qq(<a href="$script_name?action=index;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>) 110 } 111 sub { 112 my $link_title = $_[2] || "View all pages in $_[0] $_[1]"; 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 }, 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; 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; 125 126 # Ten items only at this till. 127 $#items = 10 if $#items > 10; 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 } 111 139 ); 112 140
