2017 © Pedro Peláez
 

library niconico

niconico api

image

revolution/niconico

niconico api

  • Saturday, May 19, 2018
  • by revolution
  • Repository
  • 1 Watchers
  • 1 Stars
  • 90 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 38 % Grown

The README.md

niconico API

Build Status Maintainability Test Coverage, (*1)

Requirements

PHP >= 7.3, (*2)

実装済みAPI

自分で使う用なので必要なAPIのみ実装。, (*3)

  • getthumbinfo https://dic.nicovideo.jp/a/%E3%83%8B%E3%82%B3%E3%83%8B%E3%82%B3%E5%8B%95%E7%94%BBapi
  • スナップショット検索API v2 https://site.nicovideo.jp/search-api-docs/snapshot

Install

Composer

composer require revolution/niconico

Usage

example1

<?php
use Revolution\Niconico\Search;
use Revolution\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->search($query);

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

example2

<?php
use Revolution\Niconico\Search\Query;

$query = new Query([
  'q'        => '初音ミク',
  'targets'  => 'title,tags',
  '_sort'    => '-viewCounter',
]);

example3

<?php
use Revolution\Niconico\Search\Query;

$query = Query::create([
  'q'        => '初音ミク',
  'targets'  => 'title,tags',
  '_sort'    => '-viewCounter',
])->filters([]);

example4

<?php
use Revolution\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());

example5

<?php
use Revolution\Niconico\ThumbInfo;

$thumb = new ThumbInfo('sm9');

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

publicプロパティなので変更できる。, (*4)

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

LICENSE

MIT
Copyright kawax, (*5)

The Versions

19/05 2018

dev-master

9999999-dev

niconico api

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

niconico

19/05 2018

1.1.1

1.1.1.0

niconico api

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

niconico

18/05 2018

1.1.0

1.1.0.0

niconico api

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

niconico

30/05 2017

1.0.3

1.0.3.0

niconico api

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

niconico

27/08 2016

1.0.2

1.0.2.0

niconico api

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

niconico

08/07 2016

1.0.1

1.0.1.0

niconico api

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

niconico

05/07 2016

1.0.0

1.0.0.0

niconico api

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

niconico