simple-youtube-api
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "simple-youtube-api", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A module to simplify the YouTube API.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,5 +18,5 @@ const Constants = require('../Constants'); | ||
getVideos() { | ||
getVideos(limit = 50) { | ||
return new Promise((resolve, reject) => { | ||
this.youtube.request('playlistItems', {'playlistId': this.id, 'key': this.youtube.key, 'part': Constants.PARTS.PlaylistItems, 'maxResults': 50}) | ||
this.youtube.request('playlistItems', {'playlistId': this.id, 'key': this.youtube.key, 'part': Constants.PARTS.PlaylistItems, 'maxResults': limit}) | ||
.then(result => { | ||
@@ -23,0 +23,0 @@ return resolve(result.items.map(item => { |
@@ -98,5 +98,5 @@ const request = require('request'); | ||
*/ | ||
search(query, results = 5) { | ||
search(query, limit = 5) { | ||
return new Promise((resolve, reject) => { | ||
this.request('search', {'q': query, 'maxResults': results, 'key': this.key, 'part': Constants.PARTS.Search}) | ||
this.request('search', {'q': query, 'maxResults': limit, 'key': this.key, 'part': Constants.PARTS.Search}) | ||
.then(result => { | ||
@@ -103,0 +103,0 @@ const items = result.items; |
12633