NAME

WWW::Sucksub::Extratitles - automated access to Extratitles.com

VERSION

Version 0.01

SYNOPSIS

SuckSub::Extratitles is a web automat based on the WWW::Mechanize Module This module search and collect distant result on the Extratitles.com database. Subtitles Files are very little files, Sucksub::Divstation store all results in a dbm file that you can exploit to retrieve any subtitles information.

    use WWW::Sucksub::Extratitles;
    my $foo = WWW::Sucksub::Extratitles->new(
    					dbfile=> '/where/your/DBM/file is.db',
					html =>'/where/your/html/repport/is.html',
					motif=> 'the word(s) you search',
					debug=> 1, 
					language=>'English'
					logout => '/where/your/debug/info/are/written.log',	  						);
    $foo->update(); 	# collect all link corresponding to the $foo->motif()
    $foo->motif('x'); 	# modify the search criteria 
    $foo->search();	# launch a search on the local database 

  

CONSTRUCTOR AND STARTUP

Extratitles Constructor

The new() constructor, is associated to default values : you can modify these one as shown in the synopsis example.

	my $foo = WWW::Sucksub::Extratitles->new(
		html=> "$ENV{HOME}"."/sksb_Extratitles_report.html",
		dbfile=> "$ENV{HOME}"."/sksb_Extratitles_db.db",
		motif=> undef,
		debug=> 0,
		language => 'English'
		logout => undef, # i.e. *STDOUT	  					
		useragent=> "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007"
    		);

new() constructor attributes and associated methods

Few attributes can be set thru new() contructor's attributes. All attributes can be modified by corresponding methods:

$foo->WWW::Sucksub::Extratitles->new()
$foo->useragent() # get the useragent attribute value
$foo->useragent('tructruc') # set the useragent attribute value to 'tructruc'

cookies_file()

arg must be a file, this default value can be modified by calling the

$foo->cookies_file('/where/my/cookies/are.txt')

modify the default value positionned by the new constructor.

$foo->cookies_file() 

return the actual value of the cookies file path.

useragent()

arg should be a valid useragent. There's no reason to change this default value.

$foo->useragent()

return the value of the current useragent.

motif()

you should here give a real value to this function : if $foo->motif is undef, the package execution will be aborted

$foo->motif('xxx')

allows to precise that you're searching a word that contains 'xxx'

$foo->motif()

return the current value of the string you search.

language()

Allows to set the langage for the subtitle search.

Default value is 0 : it means that all langages will be returned

$foo->langage('french')

allows to precise that you're searching a french subtitles Common langages string values are :

Albanian Argentino Bosnian Brazilian_portuguese Bulgarian Bulgarian_English Chines GB code Chinese Croatian Czech Danish Dutch/English English English - Hearing Impaired English_German Estonian Finnish French German - Hearing Impaired Germany Greek Hebrew Hungarian/English Hungary Icelandic Italy Japanese Kalle Korean

debug()

WWW-Sucksub-Extratitles can produce a lot of interresting informations The default value is "0" : that means that any debug informations will be written on the output ( see the logout() method too.)

$foo->debug(0) # stop the product of debbugging informations
$foo->debug(1) # debug info will be written to the log file ( see logout() method)

logout()

if you want some debug information : args is 1, else 0 or undef

logout => undef; 

output and optional debugging info will be produced on STDOUT or any other descriptor if you give filename as arg.

dbfile()

define dbm file for store and retrieving extracted informations you must provide a full path to the db file to store results. the search() method can not be used without defined dbm file.

dbfile('/where/your/db/is.db')

The file will should be readable/writable.

html()

Define simple html output where to write search report. you must provide au full path to the html file if you want to get an html output.

html('/where/the html/repport/is/written.html')

If $foo->html() is defined. you can get the value of this attribute like this :

my $html_page = $foo->html

html file will be used for repport with update() and search() methods. The html page IS NOT a W3C conform html. It only allows to have a direct access to http links.

METHODS and FUNCTIONS

these functions use the precedent attributes value.

search()

this function takes no arguments. it alows to launch a local dbm search.

$foo-> search()

the dbm file is read to give you every couple (title,link) which corresponds to the motif() pattern.

update()

this function takes no arguments. it allows to initiate the distant search on the web site Extratitles.com the local dbm file is automatically written. Results are accumulated to the dbm file you define with the .

get_all_result()

return a hash of every couple ( title, http link of subtitle file ) the search or update method returned.

my %hash=$foo->get_all_result()

SEE ALSO

AUTHOR

Timothée foucart, <timothee.foucart@apinc.org>

BUGS

Please report any bugs or feature requests to bug-sucksub-Extratitles@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Sucksub-Extratitles. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2006 Timothée foucart, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 233:

Non-ASCII character seen before =encoding in 'Timothée'. Assuming CP1252