ngageoint / geoq

Django web application to collect geospatial features and manage feature collection among groups of users
MIT License
694 stars 131 forks source link

Cannot connect to Twitter API #363

Open giacobe opened 8 years ago

giacobe commented 8 years ago

Having trouble connecting to Twitter API to pull data into a project as a layer.

We have reviewed the documentation, but cannot seem to resolve the OAuth issues. Using the Layer for "Social Media" and have tried to use the fields for URL and token with no success.

Any pointers would be greatly appreciated.

Also, looking for similar configuration pointers for Instragram and maybe Flickr.

stephenrjones commented 8 years ago

Hi Nick, The Twitter interface was actually a test project that an intern did here last summer. We've never rolled it into our main baseline as there were several issues that he encountered (most notably he created a daemon process to connect to Twitter and filter some of the data coming back).

Although we haven't added OAuth to the project, I would think that would be pretty doable. I've done that for another project, and used the 'requests-oauthlib' package (as well as Flask-OAuthlib as I used Flask on that project). Worked pretty well as is for GitHub integration, but had to tweak it slightly for Google OAuth.

For the Instagram and Flickr integration, one of the big things needed is a valid API key. For our Instagram, we define the "Social Media" layer url like this:

_https://api.instagram.com/v1/media/search?lat={{lat}}&lng={{lng}}&client_id={{key}}_

Then in the 'Extended Form Options' add a "key" to the 'Layer Params' field (which you get from Instagram themselves):

{ 'key' : 'abc1123...' }