Coder Social home page Coder Social logo

yandex-disk-api's Introduction

Yandex Disk Api Client

This library is built to deal with Yandex Disk API.

Installation

composer require siyahmadde/yandex-disk-api

Usage

First you need to create an alias

use Siyahmadde\Disk;
  • Get an Id from Yandex then use that id to create an object from the class
$disk = new Disk('Your Id');
  • Now you need to obtain a token from Yandex. To get the url where you can obtain the token call getLoginToken method.
$disk->getLoginToken();
  • The method call above, will return the url where you can get the token. The url will redirect you to the call back url specified while creating Yandex Disk API app. In your call back file you can call the following method. It will return the token.
Disk::handleCallback();
  • Having obtained to token, you need to set it.
$disk->setToken('your_token');
  • call this if you want PHP objects returned instead of default JSON strings
$disk->setReturnDecoded();
  • Now, you are ready to use all methods. For example:
$disk->aboutDisk();

You can also:

  • Upload files to your Yandex disk.
$disk->uploadFile('your_file');
  • Download files from your Yandex disk
$disk->downloadOwnFile('file_path');
  • Download files to your Yandex disk.
$disk->downloadOthersFile('url','whatever_you_want_to_name_it');
  • Save public files from Yandex disk to your Yandex disk.
$disk->saveToDisk('url');

-- And many more, see offical documentation

yandex-disk-api's People

Contributors

fatih-yavuz avatar

Stargazers

 avatar  avatar

Watchers

 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.