revolution/niconico

1.1.1 2018-05-19 02:13 UTC

README

Build Status

Requirements

PHP >= 7.0.0

実装済みAPI

自分で使う用なので必要なAPIのみ実装。

Install

Composer

composer require revolution/niconico

Usage

example1

use Niconico\Search;
use Niconico\Search\Query;

$query = new Query();
$query->q = "初音ミク";
$query->targets = 'title,tags';
$query->_sort = "-viewCounter";
$query->filters(['filters[mylistCounter][gte]=10000', 'filters[commentCounter][gte]=100000']);

$search = new Search();

// returns object
$response = $search->service('video')->search($query);

// returns array
$response = $search->service('video')->search($query, true);

example2

use Niconico\ThumbInfo;

$thumb = new ThumbInfo();

$thumb->get('sm9');

var_dump($thumb->video_id);//'sm9'

var_dump($thumb->toJson());
var_dump($thumb->toArray());
var_dump($thumb->toSimpleObject());

エンドポイントが変更されたら

publicプロパティなので変更できる。

$search = new Search();
$search->endpoint = 'http...';

LICENSE

MIT
Copyright kawax