Parent Directory
|
Revision Log
More DWIM changes: scrape can now also return multiple elements, which will be separated in results by <hr/>. Attribute values are now treated as words surrounded by word boundary (\b) so multiple classes separated with spaces will now be treathed correctly.
1 | dpavlin | 133 | #!/usr/bin/perl |
2 | |||
3 | use warnings; | ||
4 | use strict; | ||
5 | |||
6 | package Grep::Source::PunBB; | ||
7 | |||
8 | =head1 NAME | ||
9 | |||
10 | Grep::Source::PunBB - scraiper for PunBB search results | ||
11 | |||
12 | =cut | ||
13 | |||
14 | sub content_have { | ||
15 | qr(PunBB); | ||
16 | } | ||
17 | |||
18 | sub fetch { | ||
19 | my $self = shift; | ||
20 | my $parent = shift; | ||
21 | |||
22 | $parent->scrape( | ||
23 | submit_form => { | ||
24 | with_fields => { | ||
25 | keywords => $parent->q, | ||
26 | }, | ||
27 | }, | ||
28 | wrapper => [ qw/div class box/ ], | ||
29 | results => [ qw/div class tclcon/ ], | ||
30 | dpavlin | 134 | scrape => [ qw/div class blockpost/ ], |
31 | dpavlin | 133 | ); |
32 | |||
33 | } | ||
34 | |||
35 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |