2017 © Pedro Peláez
 

library laravel-torrent

Search for torrents with this package

image

bstien/laravel-torrent

Search for torrents with this package

  • Tuesday, March 3, 2015
  • by bstien
  • Repository
  • 2 Watchers
  • 16 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel Torrent

A package for Laravel 5 to scrape for torrents., (*1)

Installation

Add this to your composer.json:, (*2)

"require": {
    "bstien/laravel-torrent": "dev-master"
}

Register the facade and ServiceProvider in config/app.php:, (*3)

'providers' => [
    // ...
    'Stien\Torrent\TorrentServiceProvider',
];

'aliases' => [
    // ...
    'Torrent    => 'Stien\Torrent\Facades\Torrent',
];

Usage

Returns an array with Stien\Torrent\Result\Torrent-objects if matches are found. If not, an empty array is returned., (*4)

use Stien\Torrent\Facades\Torrent;
# You can register this to your facades-array in config/app.php if you like

$torrents = Torrent::search("Modern Family");

foreach( $torrents as $torrent )
{
    echo $torrent->getTitle();
}


# To search within a specific category, use any of the constants in
# Stien\Torrent\Categories.

Search in category

Include a category as the second argument to Torrent::search(). See constants in Stien\Torrent\Categories for reference., (*5)

It defaults to Categories::ALL if none are given., (*6)

use Stien\Torrent\Facades\Torrent;
use Stien\Torrent\Categories as CAT;

$torrents = Torrent::search("Die Hard", CAT::MOVIES_HD);

Implement your own adapter

To extend this package with another adapter, create a new class and have it implement Stien\Torrent\TorrentAdapterInterface., (*7)

Register your adapter with the scraper, (*8)

use Stien\Torrent\Facades\Torrent;

$myAdapter = new MyAdapter();
$myAdapter->setHttpClient(new \GuzzleHttp\Client);

Torrent::addAdapter( $myAdapter );

The Versions

03/03 2015

dev-master

9999999-dev

Search for torrents with this package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bastian Stien

03/03 2015

0.1.0

0.1.0.0

Search for torrents with this package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bastian Stien

03/03 2015

dev-dev

dev-dev

Search for torrents with this package

  Sources   Download

The Requires

 

The Development Requires

by Bastian Stien