Prepared by Scott Pletcher April 2018
Source code & Lesson files for the A Cloud Guru, Maker lab - Does-Twitter-Hate-Cats. A tongue in cheek exercise in social media mining using text analytics.
Please note, this is provided as-is, A Cloud Guru does not support this code. If you do identify any errors, then please identify and we will attempt to fix on a best efforts basis.
This file was created for the purposes of the Maker lab - Does-Twitter-Hate-Cats Course from aCloud.Guru
These files are distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
Initial creation
- install node
npm install
- Twitter Developer Account
- AWS account
- S3
- CloudWatchLog
- Kinesis
- KinesisFirehose
- DynamoDB
- Comprehend
- Lambda
1.2) After created the role, then edit Trust relationships by adding "firehose.amazonaws.com" as second service in principal section.
- rawTweets
- Partition key: id (S)
- twitterSentiment
- Partition key: sentiment (S)
named 'twitterStream'
- named 'twitterStreamFirehose' (any name)
- select the existing created IAM role
- named 'twitterUnpack'
- select S3 as a triggered using the created bucket
- put code from file 'twitterUnpack.js'
- add Env variable
- DYNAMODB_TABLE: 'rawTweets'
- Deploy
- named 'twitterUnpack'
- select DynamoDB as a triggered using the 'rawTweets' table with new record events
- put code from file 'twitterSentiment.js'
- add Env variable
- DYNAMODB_TABLE: 'twitterSentiment'
- Deploy
- edit configuration in
config.json
- edit
<Bearer Token>
inkinesis.js
as your credential from Twitter Developer Account - (optional) test running Amazon Comprehend
node comprehend.js
- run
node kinesis.js
to retrieve data from Twitter and put into S3 (each text will be separated by pipe ('|')) - validate results
- there were data in S3
- Both lambda function should be triggered
- records in DynamoDB should appear
- Final results are in 'twitterSentiment' table