项目作者: sridharsomasani

项目描述 :
Real time analytics using Storm and Twitter data
高级语言: JavaScript
项目地址: git://github.com/sridharsomasani/StormAnalytics.git
创建时间: 2017-07-05T03:00:41Z
项目社区:https://github.com/sridharsomasani/StormAnalytics

开源协议:

下载


Twitter Real-Time Analytics with Apache Storm

Country wise top tweets

  1. Final project for Udacity Twitter Real-Time Analytics with Apache Storm

This project helps to view top tweets in each country using real time Twitter data. Twitter4j is used to read stream data
from Twitter and it is the input to Apache Storm topology.

Storm parses and maps location information from each tweet to its country and calculates top hashtags from each country.
It publishes top tags and tweets to redis pub-sub channel.

Python flask server is used to bridge data analyzed from Storm to visualize it on d3js Choropleth world map.
The d3js world Choropleth map shows top tweets in each country when hovered on particular country.


Setup

  • Clone the repository
  • Install vagrant and virtualbox
  • Open command prompt in the above cloned repository

Enter following command:

  1. vagrant up
  2. It downloads all image and sets up the system for the first time
  3. vagrant ssh // logs into the vm
  4. cd /vagrant/ // you should see all your host system folders
  • Sign up for twitter developer account and register to access twitter api
  • Fill in your OAuth details in TopNTweetTopology.java file

Enter following commands to compile

  1. cd TopTweetsInCountry // assuming you are in root folder of the current repository
  2. mvn package // compiles and builds jar file in target folder in the current directory

Commands to submit topology to Storm:

  1. storm jar target/TopTweetsInCountry-0.0.1-SNAPSHOT-jar-with-dependencies.jar udacity.storm.TopNTweetTopology

To view d3 World Choropleth visualization:

  • Change directory to TopTweetsinCountry/viz folder
    1. cd TopTweetsinCountry/viz // assuming current directory is repository root
  • Start flask server using below command
    1. python app.py
  • Open browser in host machine and enter below url
    1. http://localhost:5000/map
    Note: Refer to vagrant file for port mapping

Note: The above vagrant file is taken from: https://github.com/udacity/ud381


Screenshots of d3js World Choropleth map

" class="reference-link">screenshot

" class="reference-link">screenshot

screenshot