Git Product home page Git Product logo

tweetmap.live's Introduction

TweetMap.live

A webapp that reads, geolocates and visualizes tweets from disaster regions, currently in Florida for Hurricane Irma.

This webapp contains 4 primary components:

  1. A tweet reading module, which reads Twitter's streaming API and publishes the Json responses (one for each tweet) into a Google Pub/Sub stream.
  2. A tweet recording module, which reads these Json files from the Google Pub/Sub stream, parses them and records them in a Cloud SQL Postgres database.
  3. A set of processing scripts, which sequentially work on the recorded tweets (periodically) to extract and filter location information from these tweets and records them into a geojson file.
  4. A Flask webapp, which visualises the geojson file on a map using Mapbox API. The webapp also has a page where users can train the tweets for the machine learning model to show better results in the future.

Prerequisites

  1. A Google Cloud account, with a Cloud SQL Postgres database and a Pub/Sub service ready to use. The current implementation can run on any webserver as long as the SQL database is authenticated to be accessed from these servers.
  2. Enable PostGIS in the Postgres server (its preinstalled in Google Cloud SQL).
  3. Use OSM2pgsql to load Openstreetmaps dataset that you will be querying in the project. The data for Florida was loaded from geofabrik.de.
  4. Authentication can be performed by installation of the Google Cloud SDK in these servers, which enables the direct access of services in a Google Cloud account without usernames and passwords from within that server.

Deployment steps

  1. Start running the file readTweetsPublishToPubSub.py with the correct Pub/Sub names and Twitter API credentials, to begin publishing filtered tweets to the Pub/Sub queue.
  2. The file createCloudDBandTables.py can be run once to create the database and table schema required for processing these tweets.
  3. Start the file insertTweetsIntoDB.py to start reading the Pub/Sub messages, parse them and insert them into the database. This script can be run on multiple servers to increase the throughput.
  4. Run the following periodic scripts (with periodicity as per your preference):
  5. Run the flask website using a nginx/gunicorn framework using standard methods.

tweetmap.live's People

Contributors

ramraj07 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.