KEMBAR78
Building Twitter bot using Python | PPTX
Building Twitterbot
Charlotte Bots and AI Meetup
June 2017
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
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
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
Getting Started
• Twitter setup
– Register handle
– Setup new app
– Generate oauth and access keys
• Development
– SDK available for most platforms
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
Demo - 1
• Print Timelines
• Get followers
• Follow users
• Post message
• Retweet
Demo - 2
• Trump2cash
• TwitterFollowBot

Building Twitter bot using Python

  • 1.
    Building Twitterbot Charlotte Botsand AI Meetup June 2017
  • 2.
    Bot and AInews • 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
  • 3.
    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
  • 4.
    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
  • 5.
    Getting Started • Twittersetup – Register handle – Setup new app – Generate oauth and access keys • Development – SDK available for most platforms
  • 6.
    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
  • 7.
    Demo - 1 •Print Timelines • Get followers • Follow users • Post message • Retweet
  • 8.
    Demo - 2 •Trump2cash • TwitterFollowBot