GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BitTorrent(3) User Contributed Perl Documentation BitTorrent(3)

WWW::BitTorrent - Search and Download .torrent(s) files from BitTorrents boards.

        # Creates WWW::BitTorrent Object.
        my $client = WWW::BitTorrent->new( 'site' => $site, 'user' => $user, 'pass' => $pass);

        # Check for errors.
        if ($client->{STAT} == 0) {
                print "ERROR: " . $client->{ERROR}."\n";
                exit;
        }

        # return all rows (from page 1) and prints it
        my @page = $client->browse(1);
                die("Error occured calling browse or page is empty\n") if ($#page == -1);
        
        foreach my $row (@page) {
                print "Row: " . $row->{name} . "- id: " . $row->{id} ."\n";
        }
        
        # Search for a row
        @page = $client->search('DiAMOND');
                die("No Results.\n") if ($#page == -1);

        my $download_row;

        foreach my $row (@page) {
                print "Row: " . $row->{name} . "- id: " . $row->{id} ."\n";
                $download_row = $row if ($row->{name} =~ /my.favorite.movie/);
        }

        # download .torrent file
        $client->download_torrent($download_row, '/tmp/' . $download_row->{id} . '.torrent');

"WWW::BitTorrent" provides an object interface to using two BitTorrent based boards: "TBSource", "BrokenStone" (tell me about more). This boards are being update every day with files. This module allows you to search for files in a couple of ways.

NOTE: any use of this module that is illegal is out of my responsibilty.

This module requires LWP::UserAgent and LWP::Simple.

        new( [ARGS] )

                Used to login the Board with the username and password
                of the board (all arguments are required) and create a new Object of 
                the WWW::BitTorrent module. 

                Arguments:

                site- The BitTorrents board URL address.
                user- the username for login the board. 
                pass- the password for login the board. 

                NOTES:  Returns a blessed object anyways.
                        object->{STAT}: 0 - for error (object->{ERROR} - http code)
                                        1 - for success

        browse( $page_number ) 

                Returns a list(array) of all rows(ref) from the the '$page_number' page.
                C<page_number>: number between 0 (first page) and max number of pages.

                Arguments:
        
                page_number- the number of the page you want the rows from.

        search( $keyword )

                This method do the same as browse just by the search option at the board.

        download_torrent($row, $path)

                Download the .torrent file using the LWP::Simple module.

This module was written by Amit Sides "<amit.sides@gmail.com>"

Copyright (c) 2006 Amit Sides. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2006-05-22 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.