Requirements:
-
Karma should be running on your machine. You should run karma as a service. Refer https://github.com/usc-isi-i2/Web-Karma/wiki/Karma-As-A-Service
-
Elasticsearch should be running
-
Python dependencies: Pip install geopy
API Requests:
GET request to get information on venues close to a point
https://api.foursquare.com/v2/venues/search?ll=34.02052371646544,-118.28535318374634&limit=50&radius=100&oauth_token=GGCGJ04UILGC43NGC2MRQODT1WQQQCN5EQCPORAWSIBPWKEU&v=20150508
GET request to get photos of a venue
https://api.foursquare.com/v2/venues/43695300f964a5208c291fe3/photos?oauth_token=GGCGJ04UILGC43NGC2MRQODT1WQQQCN5EQCPORAWSIBPWKEU&v=20150508
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&key=
For OSM: http://open.mapquestapi.com/xapi/ - Website
How to run the script:
python publishdata-ES.py --lat --long
In config.json file please configure the filepaths of karma-model uris and and files where
How it works:
- We send a http request to each of foursquare, googlemaps and OSM api and process the response using karma as Service model. We will publish the json ld we get from karma to ES.
Troubleshooting:
- Encode the URL always when you send http request
- Check the port numbers on which web service is running