Skip to content

Powerful OAuth API wrapper for put.io, written in PHP. Supports all features natively! (putio)

License

Notifications You must be signed in to change notification settings

Radiotechniman/put.io-api-v2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Put.io OAuth API Wrapper written in PHP

(OAuth/API Version 2)

This is a powerful PHP class for put.io's OAuth2 API (version 2). It supports all features that put.io's API provides, including file uploads, downloads, transfers, friends, etc...

It only requires PHP >=5.3! HTTP requests and JSON are supported natively if necessary!

If you have both, cURL and the JSON PHP extension installed, no configuration is required! However, if you're missing the cURL extension, you need to add one line of code:

$putio->setHTTPEngine('Native');

NOTE: Only add this line if you really don't have cURL!

Secondly, if you're missing the JSON extension, you have to download the Services_JSON package from the Pear repo. You can do that here:

http://pear.php.net/package/Services_JSON/download

Once downloaded, extract JSON.php from said package and place it into PutIO/Engines/JSON/, and you're good to go!

That's all!

Take a look at the Wiki and put.io's API documentation to get started.

Pull requests are welcome! Fix, improve, suggest!

You can also find me on Twitter: @nicoSWD

Examples

require 'PutIO/Autoloader.php';
$putio = new PutIO\API($accessToken);

// Retrieve a an array of files on your account.
$files = $putio->files->listall();

// Upload a file.
$file = 'path/to/file.jpg';
$putio->files->upload($file);

// Download a file.
$fileID = 1234;
$saveAs = 'my-file.jpg';
$putio->files->download($fileID, $saveAs);

// Search for files you have access to.
$query = 'my file';
$files = $putio->files->search($query);

// Add a new transfer (file or torrent)
$url = 'http://torrent.site.com/legal_video.torrent';
$putio->transfers->add($url);

// Get status of a transfer
$transferID = 1234;
$info = $putio->transfers->info($transferID);

// And a lot more...

License

Copyright (C) 2012 Nicolas Oelgart

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

About

Powerful OAuth API wrapper for put.io, written in PHP. Supports all features natively! (putio)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published