Foorum

 view release on metacpan or  search on metacpan

lib/Foorum/Scraper/MailMan.pm  view on Meta::CPAN

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
our $VERSION = '1.001000';
use Encode qw/from_to/;
use Encode::Guess qw/euc-cn/;    # XXX? can't explain
 
sub new {
    my $class = shift;
    my $self  = {};
 
    return bless $self => $class;
}
 
sub scraper {
    my ( $self, $url ) = @_;
 
    my $html = get($url);
    unless ($html) {
        return;
    }

lib/Foorum/Search.pm  view on Meta::CPAN

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    my $sphinx = new Foorum::Search::Sphinx;
    if ( $sphinx->can_search() ) {
        $self->{use_sphinx} = 1;
        $self->{sphinx}     = $sphinx;
    } else {
        $self->{use_db} = 1;
        $self->{db}     = new Foorum::Search::Database;
    }
 
    return bless $self => $class;
}
 
sub query {
    my ( $self, $type, $params ) = @_;
 
    # if Sphinx searchd is on and Foorum::Search::Sphinx implemented the $type
    if ( $self->{use_sphinx} and $self->{sphinx}->can($type) ) {
        return $self->{sphinx}->query( $type, $params );
    } elsif ( $self->{db}->can($type) )
    {    # if Foorum::Search::Database implemented the $type



( run in 0.427 second using v1.01-cache-2.11-cpan-49f99fa48dc )