Ejemplo n.º 1
0
         if (substr($str, 0, 7) == 'X-XML: ') {
             $xml .= substr($str, 7);
         }
         # if
     }
     # foreach
 }
 # if
 $spotParser = new SpotParser();
 $xmlar = $spotParser->parseFull($xml);
 /* Connect to the NZB group */
 /* Get the NZB file */
 $nzb = false;
 if (is_array($xmlar['segment'])) {
     foreach ($xmlar['segment'] as $seg) {
         $nzb .= implode("", $nzb_spotnntp->getBody("<" . $seg . ">"));
     }
     # foreach
 } else {
     $nzb .= implode("", $nzb_spotnntp->getBody("<" . $xmlar['segment'] . ">"));
 }
 # if
 if ($nzb !== false) {
     if ($settings['nzb_download_local'] == true) {
         $myFile = $settings['nzb_local_queue_dir'] . $xmlar['title'] . ".nzb";
         $fh = fopen($myFile, 'w') or die("Unable to open file");
         $stringData = gzinflate($spotParser->unspecialZipStr($nzb));
         fwrite($fh, $stringData);
         fclose($fh);
         echo "NZB toegevoegd aan queue : " . $myFile;
     } else {
Ejemplo n.º 2
0
<?php

require "lib/SpotNntp.php";
require "lib/SpotParser.php";
require "NNTP/Protocol/Responsecode.php";
require "NNTP/Protocol/Client.php";
require "NNTP/Client.php";
require "lib/SpotSigning.php";
require "lib/exceptions/CustomException.php";
require "lib/exceptions/NntpException.php";
require "lib/SpotSeclibToOpenSsl.php";
$server = array('host' => $argv[1], 'enc' => false, 'port' => 119, 'user' => $argv[2], 'pass' => $argv[3]);
$nntp = new SpotNntp($server);
$nntp->selectGroup('free.pt');
try {
    $r1 = array();
    $r2 = array();
    $r1 = $nntp->getBody('<*****@*****.**>');
    $r2 = $nntp->getBody('<*****@*****.**>');
} catch (Exception $x) {
    var_dump($x);
}
var_dump($r1);
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" . PHP_EOL;
var_dump($r2);