pxgamer/worldwidetorrents-php

An easy to use wrapper for the WorldWideTorrents API written in PHP.

v1.2.2 2017-12-06 10:59 UTC

This package is auto-updated.

Last update: 2024-04-11 13:41:29 UTC


README

Latest Version on Packagist Software License Build Status Style CI Code Coverage Total Downloads

An easy to use wrapper for the WorldWideTorrents API written in PHP.

Structure

src/
tests/
vendor/

Install

Via Composer

$ composer require pxgamer/worldwidetorrents-php

Usage

$client = new Client();

// Use the specific classes as their short names
use \pxgamer\WorldWideTorrents;

// Create a new Client instance
$client = new WorldWideTorrents\Client();
$client->setAuthKey('API_KEY');

// Initialise a new instance of each class
$group  = new WorldWideTorrents\Group($client);
$mail  = new WorldWideTorrents\Mail($client);
$torrent = new WorldWideTorrents\Torrent($client);
$user = new WorldWideTorrents\User($client);
$account = new WorldWideTorrents\Account($client);

Methods

Client Class

/**
 * This is required to be initialised first.
 * It must be passed into all other classes.
 */
use \pxgamer\WorldWideTorrents\Client;
$client = new Client;
$client->setAuthKey('API_KEY');

Group Class

use \pxgamer\WorldWideTorrents\Group;
$group = new Group($client);

Getting a Group's information

$group->getInfo(3);

Getting a Group's torrents

$group->getTorrents(3);

Mail Class

Initialise the Mail class

use \pxgamer\WorldWideTorrents\Mail;
$mail = new Mail($client);

Getting a user's mail stats

$mail->getStats(656);

Torrent Class

Initialise the Torrent class

use \pxgamer\WorldWideTorrents\Torrent;
$torrent = new Torrent($client);

Getting a torrent's information

$torrent->getInfo(656);

User Class

Initialise the User class

use \pxgamer\WorldWideTorrents\User;
$user = new User($client);

Getting a user's information

$user->getInfo(656);

Getting a user's torrents

$user->getTorrents(656);

Account Class

Initialise the Account class

// Requires the API key to be set in the Client class
use \pxgamer\WorldWideTorrents\Account;
$account = new Account($client);

Upload a torrent

$account->upload('torrent_title', '@C:\torrents\t.torrent', 39);

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email owzie123@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.