Coder Social home page Coder Social logo

openload-1's Introduction

OpenLoad

Packagist GitHub license Travis branch Codacy branch

It's just a php client of the OpenLoad.co service.

Install

composer require ideneal/openload:~1.1

Usage

All api features are been implemented.

Get account info

You can retrieve your account info by using getAccountInfo method.

<?php

include_once './vendor/autoload.php';

use Ideneal\OpenLoad\OpenLoadClient;

$openload = new OpenLoadClient('apiLogin', 'apiKey');

$accountInfo = $openload->getAccountInfo();
echo $accountInfo->getEmail(); //[email protected]

Get a ticket to download a file

In order to retrieve a ticket to download a file you have to use the getTicket method and pass it the remote file you want to get the ticket. The remote file has to be a FileInfo object or the file id.

<?php

include_once './vendor/autoload.php';

use Ideneal\OpenLoad\OpenLoadClient;

$openload = new OpenLoadClient('apiLogin', 'apiKey');

$fileInfo = $openload->getFileInfo('72fA-_Lq8Ak');
$ticket   = $openload->getTicket($fileInfo);

// ...
// After read the captcha response from $ticket->getCaptcha()->getUrl()

$downloadLink = $openload->getDownloadLink($ticket, $captchaResponse);

Upload a file

You can upload a file by using uploadFile method.

<?php

include_once './vendor/autoload.php';

use Ideneal\OpenLoad\OpenLoadClient;

$openload = new OpenLoadClient('apiLogin', 'apiKey');

$openload->uploadFile('/home/user/Pictures/image.jpg');

Search files with a specific name

You can use searchFiles method to search a file by its name. The first parameter is the file name, the second is a folder id (default null) and the third parameter defines whether the search has to be recursive or not (default false)

<?php

include_once './vendor/autoload.php';

use Ideneal\OpenLoad\OpenLoadClient;

$openload = new OpenLoadClient('apiLogin', 'apiKey');

$files = $openLoad->searchFiles('video.mp4', null, true);

Search folders with a specific name

You can use searchFolders method to search a folder by its name. The first parameter is the folder name, the second is a folder id (default null) and the third parameter defines whether the search has to be recursive or not (default false)

<?php

include_once './vendor/autoload.php';

use Ideneal\OpenLoad\OpenLoadClient;

$openload = new OpenLoadClient('apiLogin', 'apiKey');

$folders = $openLoad->searchFolders('movies', null, true);

It's also possible find more about what you can to do at OpenLoad Api.

Author

Daniele Pedone

License

MIT

openload-1's People

Contributors

ideneal avatar peter279k avatar j-brk avatar

Watchers

Md. Sumon Islam avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.