Foorum

 view release on metacpan or  search on metacpan

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

our $VERSION = '1.001000';
use HTML::TokeParser;
use LWP::Simple;
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


    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

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.446 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )