1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- function get_merged_torrent_results($query)
- {
- require "engines/bittorrent/thepiratebay.php";
- require "engines/bittorrent/rutor.php";
- require "engines/bittorrent/nyaa.php";
- require "engines/bittorrent/yts.php";
- $results = array_merge(get_thepiratebay_results($query),
- get_rutor_results($query),
- get_nyaa_results($query),
- get_yts_results($query));
- $seeders = array_column($results, "seeders");
- array_multisort($seeders, SORT_DESC, $results);
-
- return $results;
- }
- function print_merged_torrent_results($results)
- {
- echo "<div class=\"text-result-container\">";
- if (!empty($results))
- {
- foreach($results as $result)
- {
- $source = $result["source"];
- $name = $result["name"];
- $magnet = $result["magnet"];
- $seeders = $result["seeders"];
- $leechers = $result["leechers"];
- $size = $result["size"];
- echo "<div class=\"text-result-wrapper\">";
- echo "<a href=\"$magnet\">";
- echo "$source";
- echo "<h2>$name</h2>";
- echo "</a>";
- echo "<span>SE: <span style=\"color:#50fa7b\">$seeders</span> - ";
- echo "LE: <span style=\"color:#ff79c6\">$leechers</span> - ";
- echo "$size</span>";
- echo "</div>";
- }
- }
- else
- echo "<p>There are no results. Please try different keywords!</p>";
- echo "</div>";
- }
- ?>
|