This demo uses the following components of GCP: kubernetes, docker, pubsub, Natural Language (sentiment analysis), BigQuery, and Data Studio
If you haven't already, clone the Github repository for this demo:
git clone https://github.com/NeudesicGCP/GCPTweetCapture.git
gcloud config set project neu-ncaa
The topics that are being captured are found in the file neu-ncaa/tweetcapture/pubsub/tweet-capture-docker-image/twitter-to-pubsub.py
nano twitter-to-pubsub.py
(from /neu/tweetcapture/pubsub/tweetcapture-docker-image folder)
gcloud builds submit --tag gcr.io/neu-ncaa/tweetcapture-image .
gcloud beta container --project "neu-ncaa" clusters create "ncaatweet-cluster" --zone "us-central1-a" --service-account "neu-ncaa-tweet-serviceaccount@neu-ncaa.iam.gserviceaccount.com"
gcloud container clusters get-credentials ncaatweet-cluster --zone us-central1-a --project neu-ncaa
kubectl create -f twitter-stream.yaml
kubectl create -f bigquery-controller.yaml
kubectl get pods
kubectl delete deployment -l "name in (twitter-stream, bigquery-controller)"
###################################################################################
pip install virtualenv
virtualenv twitter
source twitter/bin/activate
twitter/bin/pip install google-cloud-language
pip install google-cloud-bigquery
python bigquery-sentiment-analysis-naturallanguage.py ncaa_tweets
###################################################################################
This visualization in Google Data Studio uses several views in BigQuery that pull from the tweet and tweetsentiment tables
https://datastudio.google.com/open/1m4S2Hqn1BCi7ql_2sfCEzz6H7x0oiAEY
###################################################################################
gcloud beta container --project "neu-ncaa" clusters delete "ncaatweet-cluster" --zone "us-central1-a"