twittermap
Project goal:
1. Displays the latest X tweets from Twitter feed
2. Displays an interactive map of the tweets where it's possible to associate the tweet with a country or other location.
- For example:
Look for the occurrence of a country name in a tweet and place it on a map. Not the location of where the tweet originated.
deploy
-
Check your docker version:
$ docker --version Docker version 17.12.0-ce, build c97c6d6 $ docker-compose --version docker-compose version 1.18.0, build 8dd22a9
To install or upgrade the docker version check:
-
Make sure you have all the Twitter and Google Maps APIs keys.
-
Start the deploy:
./scripts/deploy.sh
Cache
Twitter has a limit of request per period of the time on their api, so we cache the results on our server.
Refreshing the cache
To refresh the cache results run the command bellow.
$ docker-compose exec backend python manage.py run_cache_tweets_by_contries
tip
When you are running the project locally you can run the command watch -n <sec>
to refresh the cache every X seconds.
$ watch -n 600 docker-compose exec backend python manage.py run_cache_tweets_by_contries
Notes
For this first version I'm not setting up a Nginx
to serve static files and proxy pass to the django app.