Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_STRICT);
- include 'Torrent.php';
- ini_set('user_agent', 'PHP');
- function obterSeedLeech($hash){
- $apiURL = "http://bitsnoop.com/api/trackers.php?hash={$hash}&json=1";
- $resultado = file_get_contents($apiURL);
- return $resultado;
- }
- $torrent = new Torrent('tails-i386-1.2.3.torrent'); // Teu arquivo torrent aqui!
- $torrentHash = $torrent->hash_info(); // HASH do arquivo torrent
- $SeedsLeechs = obterSeedLeech($torrentHash);
- $SeedsLeechs = json_decode($SeedsLeechs);
- if (is_array($SeedsLeechs)){
- foreach($SeedsLeechs as $anuncios){
- echo "Anúncio: ". $anuncios->ANNOUNCE. " Seed: ". $anuncios->NUM_SEEDERS. " Leech: ". $anuncios->NUM_LEECHERS. "<br>";
- }
- } else {
- // Fazer algo aqui caso não seja retornado as informações da hash.
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement