Foorum
view release on metacpan or search on metacpan
lib/Foorum/Scraper/MailMan.pm view on Meta::CPAN
910111213141516171819202122232425262728our
$VERSION
=
'1.001000'
;
use
HTML::TokeParser;
use
LWP::Simple;
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
131415161718192021222324252627282930313233
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 )