8
Building Twitterbot Charlotte Bots and AI Meetup June 2017

Building Twitter bot using Python

Embed Size (px)

Citation preview

Page 1: Building Twitter bot using Python

Building Twitterbot

Charlotte Bots and AI Meetup

June 2017

Page 2: Building Twitter bot using Python

Bot and AI news

• Chat/Bots– Bot platforms are gaining traction – Burned by Bots - supports basic use cases with

engagement/setup frustration– Apple and MS have released home pods – Competitors to Alexa– Follow ChatbotMagazine.com of latest updates

• Data Science– Many companies (lead by startups) are coming up with AI based

solutions– Problem focus is Analytics, NLP, Voice and Vision– Automation is going to have big next gen social impact– 100’s of resources for learning data science

Page 3: Building Twitter bot using Python

Twitterbot Use cases

• Listen to tweets and respond, retweet, follow up or direct messages

• Listen to industry focus sentiments to monetize (trading)

• Monitor tweets for brand value analysis

– Send achievement notifications

– Critical Alerts

Page 4: Building Twitter bot using Python

Accessing Twitter Data

• Objects

– Tweets, Users, Entities and Places

• REST API

– Search API, Direct Messages, Collections

• Streaming API

• Rate limiting (15 minute window)

• API Console

Page 5: Building Twitter bot using Python

Getting Started

• Twitter setup

– Register handle

– Setup new app

– Generate oauth and access keys

• Development

– SDK available for most platforms

Page 6: Building Twitter bot using Python

Steps for Python

• Virtualenv setup

• Pip Install tweepy or python-twitter

• Read Tweet and parse using NLTK or Spacy or Google Cloud Natural Language API

• Build sentiment analysis (positive, neutral or negative)

• Take an action

Page 7: Building Twitter bot using Python

Demo - 1

• Print Timelines

• Get followers

• Follow users

• Post message

• Retweet