Giter Club home page Giter Club logo

amazon-connect-twitter-listener's Introduction

Amazon Connect Twitter integration

This project contains source code and supporting files for twitter streaming to Amazon Connect Tasks. Tweets are filtered on the specified tag and analyzed using comprehend to identify language and sentiment. Both tags are added as attributes to the task so additional branching decisions can be made.

Deployed resources

The project includes a cloud formation template with a Serverless Application Model (SAM) transform to deploy resources as follows:

AWS Lambda functions

  • Stream-Processor: Puts received filtered messages on task queue as specified on the ConnectTwitterConfig secret.
  • Twitter-Replier: Posts back on publication.

Kinesis Stream

  • ConnectTwitterStream: Kinesis Stream for receiving the filtered messages.

Secrets Manager Secret

  • ConnectTwitterConfig: Secret for managing Twitter Streaming API access credentials, Kinesis stream, Amazon Connect configuration and topic to be monitored.

EC2 Instance

  • TwitterListener: EC2 instance running a python script using Tweepy for connecting to Twitter API. The script is configured by the CloudFormation template to start at instance boot up. The instance is created on the default VPC.

Prerequisites.

  1. Amazon Connect Instance already set up with a queue and contact flow for handling tasks.
  2. Routing profile on Amazon Connect Instance with tasks enabled.
  3. Twitter developer account. You'll need read and write permissions for the App created.
  4. AWS Console Access with administrator account.
  5. Cloud9 IDE or AWS and SAM tools installed and properly configured with administrator credentials.
  6. KeyPair for the EC2 instance.

Deploy the solution

  1. Clone this repo.

git clone https://github.com/aws-samples/amazon-connect-twitter-listener

  1. Build the solution with SAM.

sam build -u

  1. Deploy the solution.

sam deploy -g

SAM will ask for the name of the application (name it something relevant such as "Connect-Twitter") as all resources will be grouped under it and deployment region.Reply Y on the confirmation prompt before deploying resources. SAM can save this information if you plan un doing changes, answer Y when prompted and accept the default environment and file name for the configuration.

  1. From the AWS Secrets Manager console, fill in the parameters in the ConnectTwitterConfig secret. The following parameters must be completed: Instance ID and contact flow id to handle tasks; Access Token, Access Token Secret, Consumer Key and Consumer Secret from the Twitter App; and the Twitter topic to monitor such as #AWSRules.
  2. Add the Twitter-Replier function to the Amazon Connect configuration. You can use
  3. Create a new Transfer To Queue contact flow in Amazon Connect. Add a block for invoking the Twitter-Replier function. Name it TwitterReply.
  4. Create a Quick Connect with destination Queue and the TwitterReply contactflow created in the previous step.
  5. Reboot the EC2 instance. This will start the python script, which will pull the configuration from the secret and it will start streaming data onto the Kinesis stream.
  6. Agents enabled for tasks working on the associated Queue will receive tweets in the form of tasks. After accepting the task, the agent can reply back to Tweets using the TwitterReply quick connect to transfer the task. Information entered as part of the description will be posted on the Tweet being replied to.

Resource deletion

  1. From the cloudformation console, select the stack and click on Delete and confirm it by pressing Delete Stack.

amazon-connect-twitter-listener's People

Contributors

vpalomog avatar amazon-auto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.