1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- use strict;
- use v5.10;
- AddModuleDescription('sistersites.pl', 'Sister Pages');
- our (%Action, $ScriptName, $UsePathInfo, %NearSource, %PermanentAnchors);
- $Action{'sisterpages'} = \&DoSisterPages;
- sub DoSisterPages {
- print GetHttpHeader('text/plain');
- my @pages = SisterPages();
- foreach my $id (@pages) {
- print $ScriptName . ($UsePathInfo ? '/' : '?') . UrlEncode($id)
- . ' ' . NormalToFree($id) . "\n";
- }
- }
- sub SisterPages {
- my @pages;
- push(@pages, AllPagesList()) if GetParam('pages', 1);
- push(@pages, keys %PermanentAnchors) if GetParam('permanentanchors', 1);
- push(@pages, keys %NearSource) if GetParam('near', 0);
- my $match = GetParam('match', '');
- @pages = grep /$match/i, @pages if $match;
- @pages = sort @pages;
- return @pages;
- }
|