Advertisement
Guest User

Untitled

a guest
May 12th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_STRICT);
  4. include 'Torrent.php';
  5.  
  6. ini_set('user_agent', 'PHP');
  7.  
  8. function obterSeedLeech($hash){
  9.     $apiURL = "http://bitsnoop.com/api/trackers.php?hash={$hash}&json=1";
  10.     $resultado = file_get_contents($apiURL);
  11.     return $resultado;
  12. }
  13.  
  14. $torrent = new Torrent('tails-i386-1.2.3.torrent'); // Teu arquivo torrent aqui!
  15. $torrentHash = $torrent->hash_info(); // HASH do arquivo torrent
  16.  
  17. $SeedsLeechs = obterSeedLeech($torrentHash);
  18. $SeedsLeechs = json_decode($SeedsLeechs);
  19.  
  20. if (is_array($SeedsLeechs)){
  21.     foreach($SeedsLeechs as $anuncios){
  22.         echo "Anúncio: ". $anuncios->ANNOUNCE. " Seed: ". $anuncios->NUM_SEEDERS. " Leech: ". $anuncios->NUM_LEECHERS. "<br>";
  23.     }
  24. } else {
  25.     // Fazer algo aqui caso não seja retornado as informações da hash.
  26. }
  27.    
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement