niconico API Client Library for JavaScript - unofficial
search-nico-js aims to provide a complete, asynchronous client library for the niconico Search API.
For API details and how to use promises, see the JavaScript Promises.
search-nico-js is an unofficial library.
niconico - http://www.nicovideo.jp/
http://shoito.github.io/search-nico-js/doc/
Support Promises
Use a polyfill script tag:
<script src="https://www.promisejs.org/polyfills/promise-4.0.0.js"></script>
The global variable Promise becomes available after the above script tag.
npm install search-nico-js --save
bower install search-nico-js --save
or clone the repository or just copy the files search-nico.js
or search-nico.min.js
to your server.
and then include it in your pages with <script src="search-nico.min.js"></script>
var cs = SearchNico.contents({
'issuer': 'search-nico-js',
'reason': 'html5jc'
});
var csPromise = cs.service('video')
.keyword('hoge')
.target(['title','description','tags'])
.filter([
cs.equalFilter('ppv_type', 'free'),
cs.rangeFilter('view_counter', '100', '1000', true, false)
])
.sort('view_counter', 'asc')
.select(['cmsid','title','description','view_counter','mylist_counter'])
.from(0)
.size(5)
.fetch();
csPromise.then(function(result) {
console.log(result);
}, function(err) {
console.error(err);
});
MIT License - http://opensource.org/licenses/MIT