Closed ghost closed 8 years ago
@SuttJ Not at this point, but I'm hoping to add this functionality soon. I'll let you know when I do!
Thanks! - I was gonna poke around and see if I could do it this weekend.
Awesome, I was thinking I would need to modify the url in src/utils/trendData
to add some date parameters. Right now the url that it retrieves trend data from is:
http://www.google.com/trends/fetchComponent?q="${keyword}"&cid=TIMESERIES_GRAPH_0&export=3
But there must be a way to specify date
So I played with the url request a bit and I've discovered that date specifications are done by adding &date=foo
to the url. So in this case it would look like:
http://www.google.com/trends/fetchComponent q="${keyword}"&cid=TIMESERIES_GRAPH_0&export=3&date=foo
For the date options:
Past 30 days: date=today%201-m
Past 7 days: date=now%207-d
Past 24 Hours: date=now%201-d
If you wanna see all options, just go to https://www.google.com/trends/explore?date=now%201-H&q=Apple and change the date dropdown menu and look at how the date
value in the url changes.
So I tried just adding one of the date statements to the url in src/utilities/trendData
but it makes the parseJSON()
function in src/resources/htmlParser.js
throw an error.
Hmm, I'm hoping I will have a chance this weekend to take a look. Sorry for the delay!
@SuttJ Added a timePeriod
parameter to trendData
- for example:
{keywords: ['michael phelps'], timePeriod: {type: 'hour', value: 5}}
In order to see trend data for a keyword in a given time frame e.g. past year, past month, past week.
I noticed it wasn't in the documentation, also didn't work when I tested it.