Skip to content
Simple sentiment analysis on hashtags or a users tweets using the Node/React, Google NLP Sentiment API, the Datumbox Sentiment API, and the Twitter API
JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build-error
build
client
config
logs
.env
.gitignore
.npmignore
README.md
combined.log
demo1.png
demo2.png
demo3.png
error.log
exampleAPIResponses.txt
package-lock.json
package.json
server.js

README.md

Twitter Sentiment Analysis

Built with:

  • React
  • Node
  • DatumBox Sentiment API
  • Google Sentiment API

Positive hashtag example: demo1

Negative hashtag example: demo2

Username example: demo3

Description:

Analyze tweet sentiment using an username or hashtag using two sentiment APIs. I originally created this app a couple years ago but it is tested on:

Node 10.17.0 Npm 6.11.3

The live app is running on Herkoku and can be tried out at: https://salty-journey-93853.herokuapp.com/

Requirements

In order to run this app, you will need to sign up for the following free APIs:

  1. The Datumbox Machine Learning API: https://www.datumbox.com/machine-learning-api/

  2. The Google Natural Language Processing API: https://cloud.google.com/natural-language/docs/basics

  3. The Twitter API https://developer.twitter.com/en/docs

After signing up for the APIs, create a file called 'config.js' in the repository root with the following API credentials:

const config = { twitter: { consumer_key: '', consumer_secret: '', access_token: '', access_token_secret: '' }, google: { "apiKey" : '' }, datumBox: { "apiKey" : '', }, port: process.env.PORT || 3000 };

module.exports = config;

To change ports or HOST to a live URL edit the .env file

Usage

  1. Install dependencies and run the app:
   npm install
   npm start

API requests will be visible via terminal output

  1. Go to http://0.0.0.0:3000/ to see the App

TODO:

Dockerfile Get All Tweets MongoDB to store tweet sentiment over time, or requests npm audit fix

You can’t perform that action at this time.