/[Grep]/lib/Grep/Source/MoinMoin.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/Grep/Source/MoinMoin.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 132 - (show annotations)
Tue May 1 12:20:49 2007 UTC (17 years ago) by dpavlin
File size: 586 byte(s)
Implemented redirect_single_result option for sources (MoinMoin uses that), and documented
element_by_triplet and scrape
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 package Grep::Source::MoinMoin;
7
8 =head1 NAME
9
10 Grep::Source::MoinMoin - scraper for MoinMoin wiki search results
11
12 =cut
13
14 sub content_have {
15 qr/MoinMoin/
16 }
17
18 sub fetch {
19 my $self = shift;
20 my $parent = shift;
21
22 $parent->scrape(
23 # submit_form => {
24 # fields => {
25 # value => $parent->q,
26 # },
27 # button => 'fullsearch',
28 # },
29 wrapper => [ qw/div class searchresults/ ],
30 results => 'dt',
31 scrape => [ qw/div id page/ ],
32 # when search returns just single hit, it will redirect to result page
33 redirect_single_result => 1,
34 );
35
36 }
37
38 1;

  ViewVC Help
Powered by ViewVC 1.1.26