Parent Directory | Revision Log
refactor most of code for scraping into common code making plugins really simple
1 | dpavlin | 73 | #!/usr/bin/perl |
2 | dpavlin | 72 | |
3 | use warnings; | ||
4 | use strict; | ||
5 | |||
6 | package Grep::Source::MoinMoin; | ||
7 | |||
8 | dpavlin | 73 | =head1 NAME |
9 | |||
10 | Grep::Source::MoinMoin - scraper for MoinMoin wiki search results | ||
11 | |||
12 | =cut | ||
13 | |||
14 | dpavlin | 72 | sub content_have { |
15 | qr/MoinMoin/ | ||
16 | } | ||
17 | |||
18 | sub fetch { | ||
19 | my $self = shift; | ||
20 | my $parent = shift; | ||
21 | |||
22 | dpavlin | 85 | $parent->scrape( |
23 | submit_form => { | ||
24 | fields => { | ||
25 | value => $parent->q, | ||
26 | }, | ||
27 | button => 'fullsearch', | ||
28 | dpavlin | 72 | }, |
29 | dpavlin | 85 | wrapper => [ qw/div class searchresults/ ], |
30 | results => 'dt', | ||
31 | scrape => [ qw/div id page/ ], | ||
32 | ); | ||
33 | dpavlin | 72 | |
34 | } | ||
35 | |||
36 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |