Parent Directory
|
Revision Log
refactor most of code for scraping into common code making plugins really simple
1 | dpavlin | 73 | #!/usr/bin/perl |
2 | |||
3 | use warnings; | ||
4 | use strict; | ||
5 | |||
6 | package Grep::Source::PhpWiki; | ||
7 | |||
8 | =head1 NAME | ||
9 | |||
10 | dpavlin | 85 | Grep::Source::PhpWiki - scraiper for PhpWiki search results |
11 | dpavlin | 73 | |
12 | =cut | ||
13 | |||
14 | sub content_have { | ||
15 | qr(generator.*PhpWiki); | ||
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 | # }, | ||
29 | wrapper => [ qw/div id FullTextSearchPlugin/ ], | ||
30 | results => 'dt', | ||
31 | scrape => [ qw/div class wikitext/ ], | ||
32 | ); | ||
33 | dpavlin | 73 | |
34 | } | ||
35 | |||
36 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |