elibus / j-google-trends-client

Java Client for Google Trends
12 stars 12 forks source link

Client is not able to handle dates #6

Closed inkrement closed 9 years ago

inkrement commented 9 years ago

The following call seems valid

java -jar j-google-trends-client-1.2.8-jar-with-dependencies.jar \
 -u blabla \
 -p secret
 -q "U2" \
 -o 'date=10%2F2011%201m&gprop=youtube&cat=0-3'

and it works in the browser: http://www.google.at/trends/explore#date=10%2F2011%201m&gprop=youtube&cat=0-3&q=U2

But if I run the client I get the following error

Exception in thread "main" org.freaknet.gtrends.client.exceptions.HierarchicalDownloaderException: org.freaknet.gtrends.api.exceptions.GoogleTrendsClientException: *** You are running too fast man! Looks like you reached your quota limit. Wait a while and slow it down with the '-S' option! *** 
    at org.freaknet.gtrends.client.HierarchicalDownloader.start(HierarchicalDownloader.java:129)
    at org.freaknet.gtrends.client.App.main(App.java:81)
Caused by: org.freaknet.gtrends.api.exceptions.GoogleTrendsClientException: *** You are running too fast man! Looks like you reached your quota limit. Wait a while and slow it down with the '-S' option! *** 
    at org.freaknet.gtrends.api.GoogleTrendsClient.execute(GoogleTrendsClient.java:75)
    at org.freaknet.gtrends.client.HierarchicalDownloader.start(HierarchicalDownloader.java:100)
    ... 1 more

But this cannot be the case! If I remove the -o argument, it works as expected. The group and category part work, but the date produces the error. Is the client able to handle dates?

elibus commented 9 years ago

Please try without URL encoding, ie. %2F should be replaced by / and %20 and space

inkrement commented 9 years ago

oh. thx, this solved the problem!