File: example.php

Recommend this page to a friend!
  Classes of Sazan Dauti  >  PHP Pirate Bay  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: An example of how to use the class
Class: PHP Pirate Bay
Search for torrents on thepiratebay.se site
Author: By
Last change:
Date: 6 years ago
Size: 902 bytes
 

Contents

Class file image Download
<?php

require("thepiratebay.class.php");

$query = "example";
$page = 1;

$tpb = new ThePirateBay;
$search = $tpb->searchTorrents($query, $page);

foreach (
$search as $info) {
   
$name = $info['name'];
   
$link = $info['link'];
   
$main_category = $info['main_category'];
   
$secondary_category = $info['secondary_category'];
   
$seeders = $info['seeders'];
   
$leechers = $info['leechers'];
   
$description = $info['description'];
   
$magnet_link = $info['magnet_link'];
   
    echo
"Name: " . $name . "<br />Link: " . $link . "<br />Main Category: " . $main_category . "<br />Secondary Category: " . $secondary_category . "<br />Seeders: " . $seeders . "<br />Leechers: " . $leechers . "<br />Description: " . $description . "<br />Magnet Link: " . $magnet_link . "<br /><br />---------------<br /><br />";
   
}

?>


For more information send a message to info at phpclasses dot org.