Analyzing social media sentiment and its impact on stock market
Personal project, does not represent Google
This Go app deploys into GKE, subscribes to Twitter stream for all companies defined in the Stocks
table in Cloud Spanner and scores each event against the Google NLP API while comparing the user sentiment against the stock ask price against Yahoo API.
Eventually there will be a UI, for now, there are sample SQL scripts you can use to execute against the Cloud Spanner DB to analyze the data.
All GCP services used in this example can be run under the GCP Free Tier plan. More more information see https://cloud.google.com/free/
Edit the scripts/config.sh
file with your Twitter API info. Alternatively
define the following environment variables. Instructions how to configure your Twitter API access codes are found here:
# export T_CONSUMER_KEY=""
# export T_CONSUMER_SECRET=""
# export T_ACCESS_TOKEN=""
# export T_ACCESS_SECRET=""
Once all the necessary environment variables are defined you can execute the tsignal
appl locally go run *.go
or use the included Dockerfile
to create an image which you can then publish to the GCP (if needed, there is a script build-publish
that will do all that for you.
The cleanup of all the resources created in this application can be accomplished by executing the scripts/cleanup.sh
script.
- Tests, yes please
- UI for reports and config
- Way to subscribe to non-NASDAQ stock prices