Added settings for source type

This commit is contained in:
Lennard Westerveld 2015-03-24 15:23:14 +01:00
parent e15ccb5510
commit 1aa77581a4
2 changed files with 5 additions and 1 deletions

View file

@ -21,7 +21,9 @@ Bing.web("Pizza", function(error, res, body){
}, },
{ {
top: 10, // Number of results (max 50) top: 10, // Number of results (max 50)
skip: 3 // Skip first 3 results skip: 3, // Skip first 3 results
sources: "web+news", //Choises are web+image+video+news+spell
newssortby: "Date" //Choices are Date, Relevance
}); });
``` ```

View file

@ -62,6 +62,8 @@ var Bing = function( options ) {
+ qs.stringify({ "Query": "'" + query + "'" }) + qs.stringify({ "Query": "'" + query + "'" })
+ "&$top=" + opts.top + "&$top=" + opts.top
+ "&$skip=" + opts.skip + "&$skip=" + opts.skip
+ (opts.sources ? "&Sources=%27" + opts.sources + "%27" : '')
+ (opts.newssortby ? "&NewsSortBy=%27" + opts.newssortby + "%27" : '')
+ (opts.market ? "&Market=%27" + opts.market + "%27" : '') + (opts.market ? "&Market=%27" + opts.market + "%27" : '')
+ (opts.adult ? "&Adult=%27" + opts.adult + "%27" : '') + (opts.adult ? "&Adult=%27" + opts.adult + "%27" : '')
+ (opts.imagefilters + (opts.imagefilters