Add videoSortBy option

This commit is contained in:
goferito 2015-10-07 02:13:24 +02:00
parent c72b9b03e4
commit 2501d2a637
4 changed files with 8 additions and 3 deletions

View file

@ -72,7 +72,10 @@ Bing.video("monkey vs frog", {
videofilters: {
duration: 'short',
resolution: 'high'
}
},
videoSortBy: 'Date' // Choices are:
// Date
// Relevance
}, function(error, res, body){
console.log(body);
});

View file

@ -75,6 +75,7 @@ var Bing = function (options) {
+ (opts.imagefilters
? '&' + qs.stringify({ "ImageFilters": "'" + opts.imagefilters + "'" })
: '')
+ (opts.videoSortBy ? "&VideoSortBy=%27" + opts.videoSortBy + "%27" : '')
+ (opts.videofilters
? '&' + qs.stringify({ "VideoFilters": "'" + opts.videofilters + "'" })
: '');

View file

@ -1,6 +1,6 @@
{
"name": "node-bing-api",
"version": "2.0.0",
"version": "2.1.0",
"description": "Node.js module for the Azure Bing Search API",
"main": "index.js",
"author": "Mr. Goferito",

View file

@ -147,7 +147,8 @@ describe("Bing Video", function () {
videofilters: {
duration: 'short',
resolution: 'high'
}
},
videoSortBy: 'Date'
},
function (err, res, body) {