Source for file scrape.php
Documentation is available at scrape.php
* Fetch the statistics for a torrent
* # php scrape.php -t file
* @author Markus Tacker <m@tacker.org>
* @version $Id: scrape.php 35 2005-07-21 10:58:19Z m $
require_once 'File/Bittorrent/Decode.php';
require_once 'Console/Getargs.php';
// Get filename from command line
'desc' => 'Filename of the torrent'
$args = & Console_Getargs ::factory ($args_config);
if (PEAR ::isError ($args) or !($torrent = $args->getValue ('torrent'))) {
echo Console_Getargs ::getHelp ($args_config). "\n";
echo 'ERROR: "' . $torrent . "\" is not readable.\n";
$File_Bittorrent_Decode->decodeFile ($torrent);
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
echo 'Tracker: ' . $File_Bittorrent_Decode->announce . "\n";
echo 'info hash: ' . $File_Bittorrent_Decode->info_hash . "\n";
foreach ($File_Bittorrent_Decode->getStats () as $key => $val) {
echo str_pad($key . ':', 20 ) . $val . "\n";
Documentation generated on Mon, 11 Mar 2019 14:18:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|