hrbrmstr / newsflash

Tools to Work with the Internet Archive and GDELT Television Explorer in R
90 stars 9 forks source link

Api2 changes #15

Closed MikeGruz closed 6 years ago

MikeGruz commented 6 years ago

Big first stab at fixing the query_tv function to reflect changes in the GDELT TV API as of v2.0. Some of the parameters originally in the package (e.g., histogram, etc) aren't currently working, but the base functionality is there.

Note that searches < 7 days don't return any hms values - I have spoken to the creator of the API, who is going to look into it.

dietrichson commented 6 years ago

@MikeGruz , I integrated the PR locally and rebuilt the package. I still get a (different) error when running one of the example queries:

`

query_tv("mexican president") Response [https://api.gdeltproject.org/api/v2/tv/tv?query=mexican+president%20(market:%22National%22)%20&datacomb=separate&mode=timelinevol&datanorm=perc&format=json&timelinesmooth=0&filter_timespan=ALL] Date: 2018-03-24 19:12 Status: 200 Content-Type: application/json; charset=utf-8 Size: 2 B Error in readBin(content, character()) : invalid connection `

NB: The error does not seem to actually alter the results.

hrbrmstr commented 6 years ago

lemme take a look. It may very well be something I need to tweak in existing functions.