Add videoSortBy option
This commit is contained in:
parent
c72b9b03e4
commit
2501d2a637
4 changed files with 8 additions and 3 deletions
|
@ -72,7 +72,10 @@ Bing.video("monkey vs frog", {
|
||||||
videofilters: {
|
videofilters: {
|
||||||
duration: 'short',
|
duration: 'short',
|
||||||
resolution: 'high'
|
resolution: 'high'
|
||||||
}
|
},
|
||||||
|
videoSortBy: 'Date' // Choices are:
|
||||||
|
// Date
|
||||||
|
// Relevance
|
||||||
}, function(error, res, body){
|
}, function(error, res, body){
|
||||||
console.log(body);
|
console.log(body);
|
||||||
});
|
});
|
||||||
|
|
|
@ -75,6 +75,7 @@ var Bing = function (options) {
|
||||||
+ (opts.imagefilters
|
+ (opts.imagefilters
|
||||||
? '&' + qs.stringify({ "ImageFilters": "'" + opts.imagefilters + "'" })
|
? '&' + qs.stringify({ "ImageFilters": "'" + opts.imagefilters + "'" })
|
||||||
: '')
|
: '')
|
||||||
|
+ (opts.videoSortBy ? "&VideoSortBy=%27" + opts.videoSortBy + "%27" : '')
|
||||||
+ (opts.videofilters
|
+ (opts.videofilters
|
||||||
? '&' + qs.stringify({ "VideoFilters": "'" + opts.videofilters + "'" })
|
? '&' + qs.stringify({ "VideoFilters": "'" + opts.videofilters + "'" })
|
||||||
: '');
|
: '');
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "node-bing-api",
|
"name": "node-bing-api",
|
||||||
"version": "2.0.0",
|
"version": "2.1.0",
|
||||||
"description": "Node.js module for the Azure Bing Search API",
|
"description": "Node.js module for the Azure Bing Search API",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Mr. Goferito",
|
"author": "Mr. Goferito",
|
||||||
|
|
|
@ -147,7 +147,8 @@ describe("Bing Video", function () {
|
||||||
videofilters: {
|
videofilters: {
|
||||||
duration: 'short',
|
duration: 'short',
|
||||||
resolution: 'high'
|
resolution: 'high'
|
||||||
}
|
},
|
||||||
|
videoSortBy: 'Date'
|
||||||
},
|
},
|
||||||
function (err, res, body) {
|
function (err, res, body) {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue