Closed Dayjo closed 7 years ago
@Dayjo I left implementation of searching multiple keywords out, but it's something that could be added. Alternatively, you could make an array of promises, something like the following:
let words = ['toast', 'strawberry'];
let promiseArr = words.map((keyword) => {
return googleTrends.interestOverTime({keyword});
});
Promise.all(promiseArr)
.then((results) => {
console.log('results!', results);
/*
* here results is an array where the first element are the results for `toast`
* and the second element are the results for `strawberry`
*/
});
@pat310 Unfortunately that doesn't have the same effect, as the scale is always relative to the query.
i.e. the individual query for strawberry maxes at 100 (the highest interest), and the individual query for toast also maxes at 100. If you query them together, however, they scale relative to each other so that the max for either is 100 and actually the max for toast is much lower (around 50, so half the interest of strawberry).
I hope that makes sense haha
TL;DR - You cannot compare two individual queries as the scale is relative to itself, not each other.
Is it that when I do use comma separated, it's potentially 'working', but the library can't handle the multiple arrays returned or something? I will look at implementing this today if I can figure out what it's doing :)
I have determined what's needed here. The comparisonItem
simply needs to send multiple objects. Should be straight forward enough to add support for multiple objects I hope! :)
Hello,
Since the version change (and the documentation change), It's unclear how to query multiple keywords. Previously it was a keywords parameter which could be an array. Now it's singular
keyword
, and it doesn't seem to support an array.I have tried using a comma separated list but just get empty results, i.e.
I tried the following;
also tried..
Essentially I'm looking for something like this;
Have I missed something?