KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
laravel-torrent
★ 17
Open GitHub ↗
No description available.
Download README (.md)
Explore Similar Repositories
jargo
:
Access to Java JAR file information from Go
opencart-twig
:
Twig Template Engine For Opencart - OCMOD
linter-chktex
:
An Atom Linter plugin for LaTeX, using chktex
homebrew-pebble-sdk
:
Pebble Homebrew Tap
Data-Science-Skill
:
Collection of Courses and Books needed for Data Science learning.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
laravel-torrent
?
Download (.md)
# Laravel Torrent A package for [Laravel 5](http://laravel.com/) to scrape for torrents. ## Installation Add this to your `composer.json`: ```json "require": { "bstien/laravel-torrent": "dev-master" } ``` Register the facade and ServiceProvider in `config/app.php`: ```php 'providers' => [ // ... 'Stien\Torrent\TorrentServiceProvider', ]; 'aliases' => [ // ... 'Torrent => 'Stien\Torrent\Facades\Torrent', ]; ``` ## Usage ### Regular search Returns an array with `Stien\Torrent\Result\Torrent`-objects if matches are found. If not, an empty array is returned. ```php 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. It defaults to `Categories::ALL` if none are given. ```php 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`. Register your adapter with the scraper ```php use Stien\Torrent\Facades\Torrent; $myAdapter = new MyAdapter(); $myAdapter->setHttpClient(new \GuzzleHttp\Client); Torrent::addAdapter( $myAdapter ); ```