Session 8: Bots

This file is located at http://brwn.co/home8.

Once you get to the Colab site, select File->Save a Copy in Drive. Then you’re good to go!

Bots

Today we are going to look at “bots” and their role as both the subject of as well as a platform for journalism. We will see examples of bots that notify, responding to events in the world, and bots that inform, providing context to a story. We are going to start with one of the first bots, what we might today call a conversational bot. Let’s try it out and talk about it later - it’s name is ELIZA.

#@title
from re import match, IGNORECASE
from random import choice
 
reflections = {
    "am": "are",
    "was": "were",
    "i": "you",
    "i'd": "you would",
    "i've": "you have",
    "i'll": "you will",
    "my": "your",
    "are": "am",
    "you've": "I have",
    "you'll": "I will",
    "your": "my",
    "yours": "mine",
    "you": "me",
    "me": "you"
}
 
actions = [
    [r'I need (.*)',
     ["Why do you need {0}?",
      "Would it really help you to get {0}?",
      "Are you sure you need {0}?"]],
 
    [r'Why don\'?t you ([^\?]*)\??',
     ["Do you really think I don't {0}?",
      "Perhaps eventually I will {0}.",
      "Do you really want me to {0}?"]],
 
    [r'Why can\'?t I ([^\?]*)\??',
     ["Do you think you should be able to {0}?",
      "If you could {0}, what would you do?",
      "I don't know -- why can't you {0}?",
      "Have you really tried?"]],
 
    [r'I can\'?t (.*)',
     ["How do you know you can't {0}?",
      "Perhaps you could {0} if you tried.",
      "What would it take for you to {0}?"]],
 
    [r'I am (.*)',
     ["Did you come to me because you are {0}?",
      "How long have you been {0}?",
      "How do you feel about being {0}?"]],
 
    [r'I\'?m (.*)',
     ["How does being {0} make you feel?",
      "Do you enjoy being {0}?",
      "Why do you tell me you're {0}?",
      "Why do you think you're {0}?"]],
 
    [r'Are you ([^\?]*)\??',
     ["Why does it matter whether I am {0}?",
      "Would you prefer it if I were not {0}?",
      "Perhaps you believe I am {0}.",
      "I may be {0} -- what do you think?"]],
 
    [r'What (.*)',
     ["Why do you ask?",
      "How would an answer to that help you?",
      "What do you think?"]],
 
    [r'How (.*)',
     ["How do you suppose?",
      "Perhaps you can answer your own question.",
      "What is it you're really asking?"]],
 
    [r'Because (.*)',
     ["Is that the real reason?",
      "What other reasons come to mind?",
      "Does that reason apply to anything else?",
      "If {0}, what else must be true?"]],
 
    [r'(.*) sorry (.*)',
     ["There are many times when no apology is needed.",
      "What feelings do you have when you apologize?"]],
 
    [r'Hello(.*)',
     ["Hello... I'm glad you could drop by today.",
      "Hi there... how are you today?",
      "Hello, how are you feeling today?"]],
 
    [r'I think (.*)',
     ["Do you doubt {0}?",
      "Do you really think so?",
      "But you're not sure {0}?"]],
 
    [r'(.*) friend (.*)',
     ["Tell me more about your friends.",
      "When you think of a friend, what comes to mind?",
      "Why don't you tell me about a childhood friend?"]],
 
    [r'Yes',
     ["You seem quite sure.",
      "OK, but can you elaborate a bit?"]],
 
    [r'(.*) computer(.*)',
     ["Are you really talking about me?",
      "Does it seem strange to talk to a computer?",
      "How do computers make you feel?",
      "Do you feel threatened by computers?"]],
 
    [r'Is it (.*)',
     ["Do you think it is {0}?",
      "Perhaps it's {0} -- what do you think?",
      "If it were {0}, what would you do?",
      "It could well be that {0}."]],
 
    [r'It is (.*)',
     ["You seem very certain.",
      "If I told you that it probably isn't {0}, what would you feel?"]],
 
    [r'Can you ([^\?]*)\??',
     ["What makes you think I can't {0}?",
      "If I could {0}, then what?",
      "Why do you ask if I can {0}?"]],
 
    [r'Can I ([^\?]*)\??',
     ["Perhaps you don't want to {0}.",
      "Do you want to be able to {0}?",
      "If you could {0}, would you?"]],
 
    [r'You are (.*)',
     ["Why do you think I am {0}?",
      "Does it please you to think that I'm {0}?",
      "Perhaps you would like me to be {0}.",
      "Perhaps you're really talking about yourself?"]],
 
    [r'You\'?re (.*)',
     ["Why do you say I am {0}?",
      "Why do you think I am {0}?",
      "Are we talking about you, or me?"]],
 
    [r'I don\'?t (.*)',
     ["Don't you really {0}?",
      "Why don't you {0}?",
      "Do you want to {0}?"]],
 
    [r'I feel (.*)',
     ["Good, tell me more about these feelings.",
      "Do you often feel {0}?",
      "When do you usually feel {0}?",
      "When you feel {0}, what do you do?"]],
 
    [r'I have (.*)',
     ["Why do you tell me that you've {0}?",
      "Have you really {0}?",
      "Now that you have {0}, what will you do next?"]],
 
    [r'I would (.*)',
     ["Could you explain why you would {0}?",
      "Why would you {0}?",
      "Who else knows that you would {0}?"]],
 
    [r'Is there (.*)',
     ["Do you think there is {0}?",
      "It's likely that there is {0}.",
      "Would you like there to be {0}?"]],
 
    [r'My (.*)',
     ["I see, your {0}.",
      "Why do you say that your {0}?",
      "When your {0}, how do you feel?"]],
 
    [r'You (.*)',
     ["We should be discussing you, not me.",
      "Why do you say that about me?",
      "Why do you care whether I {0}?"]],
 
    [r'Why (.*)',
     ["Why don't you tell me the reason why {0}?",
      "Why do you think {0}?"]],
 
    [r'I want (.*)',
     ["What would it mean to you if you got {0}?",
      "Why do you want {0}?",
      "What would you do if you got {0}?",
      "If you got {0}, then what would you do?"]],
 
    [r'(.*) mother(.*)',
     ["Tell me more about your mother.",
      "What was your relationship with your mother like?",
      "How do you feel about your mother?",
      "How does this relate to your feelings today?",
      "Good family relations are important."]],
 
    [r'(.*) father(.*)',
     ["Tell me more about your father.",
      "How did your father make you feel?",
      "How do you feel about your father?",
      "Does your relationship with your father relate to your feelings today?",
      "Do you have trouble showing affection with your family?"]],
 
    [r'(.*) child(.*)',
     ["Did you have close friends as a child?",
      "What is your favorite childhood memory?",
      "Do you remember any dreams or nightmares from childhood?",
      "Did the other children sometimes tease you?",
      "How do you think your childhood experiences relate to your feelings today?"]],
 
    [r'(.*)\?',
     ["Why do you ask that?",
      "Please consider whether you can answer your own question.",
      "Perhaps the answer lies within yourself?",
      "Why don't you tell me?"]],
 
    [r'quit',
     ["Thank you for talking with me.",
      "Good-bye.",
      "Thank you, that will be $150.  Have a good day!"]],
 
    [r'(.*)',
     ["Please tell me more.",
      "Let's change focus a bit... Tell me about your family.",
      "Can you elaborate on that?",
      "Why do you say that {0}?",
      "I see.",
      "Very interesting.",
      "{0}.",
      "I see.  And what does that tell you?",
      "How does that make you feel?",
      "How do you feel when you say that?"]]
]
 
 
def reflect(fragment):
    
    # Turn a string into a series of words
    tokens = fragment.lower().split()
    
    # for each word...
    for i in range(len(tokens)):
        token = tokens[i]
    
        # see if the word is in the "reflections" list and if it
        # is, replace it with its reflection (you -> me, say)
        if token in reflections:
            tokens[i] = reflections[token]
            
    return ' '.join(tokens)
 
 
def respond(statement):
    
    # run through all the actions
    for j in range(len(actions)):
    
        # for each one, see if it matches the statment that was typed
        pattern = actions[j][0] 
        responses = actions[j][1]
        found = match(pattern, statement.rstrip(".!"),IGNORECASE)
        
        if found:
        
            # for the first match, select a response at random and insert
            # the text from the statement into ELIZA's response
            response = choice(responses)
            return response.format(*[reflect(g) for g in found.groups()])
 
 
def eliza():
    # a friendly welcome
    print("Hello. How are you feeling today?")
 
    # talk forever...
    while True:
        
        # collect a statement and respond, stop the conversation on 'quit'
        statement = input("> ")
        print(respond(statement))
 
        if statement == "quit":
            break

eliza()
Hello. How are you feeling today?
> I feel a little tired actually.
Good, tell me more about these feelings.
> Well, it was a long weekend self-isolating.
Can you elaborate on that?
> quit
Good-bye.

You end the conversation by typing quit into the text area above. Let’s have a look at some of the code that’s making ELIZA tick. The reflect() function turns and “I” into a “you”, allowing the program to turn a user’s statement “Because I love apples” around into the question “If you love apples, what else must be true?” Here is reflect() working on single phrases.

reflect("I am troubled")
'you are troubled'
reflect("your analysis is wrong")
'my analysis is wrong'

Next, let’s look at the respond() function a little more closely. It draws on a list of action pairs. The first element of each pair describes something a person might type into the interface. We see things like

      r"Can you ([^\?]*)\??"

or

      "I want (.*)"

or in good therapist style

      "(.*) mother(.*)"

The second element of each pair is a set of phrases that ELIZA might respond with. These are chosen at random. A match with the last pattern referring to mother, we would be offered one of these lines of text.

      "Tell me more about your mother."
      "What was your relationship with your mother like?"
      "How do you feel about your mother?"
      "How does this relate to your feelings today?"
      "Good family relations are important."

You’ll notice that some of the responses contain {0} which provides ELIZA with the capacity to include some of what you said in its answer. This gives ELIZA the sense that it is engaged in a conversation - it remembers what you said. OK, just the last thing you said, but you get the idea about how we might build up more memory.

To see how this works, if you typed something that matched the pattern

      'I am (.*)'

the response would be one of the following

      "Did you come to me because you are {0}?"
      "How long have you been {0}?"
      "How do you feel about being {0}?"

Give it a go!

respond("I am lost.")
'How long have you been lost?'

Again, the same recipe. Because ELIZA’s author anticipated people wondering about ELIZA’s identity, there is an explicit pattern

      "(.*) computer(.*)"

which will elicit one of these responses

      "Are you really talking about me?"
      "Does it seem strange to talk to a computer?"
      "How do computers make you feel?"
      "Do you feel threatened by computers?"
respond("ELIZA, you must be a computer!")
'Are you really talking about me?'

Conversational bots

You get the idea. Constructing a conversational bot like ELIZA can be a bit like writing a script for a play. They are incredibly hard (in my opinion) to get right. They have also been around for a long time.

From Voice User Interface Design: New Solutions to Old Problems

Like many technologies that seem fresh off the presses, conversational interfaces have been in the public consciousness for decades and in research circles even longer. Bell Laboratories debuted their “Audrey” system (the first voice controlled UI) in 1952

<img src=https://cdn-images-1.medium.com/max/1600/1*_7DuZTz-nVAkLnuHHcZY5A.jpeg style=”width: 60%; border: #000000 1px outset;”/>

Developed in 1952, Audrey - a conversational interface, a voice interface - even predates Star Trek’s aspirational voice controlled computer!

Here’s the uncanny episode from 1966.

from IPython.display import YouTubeVideo
YouTubeVideo('1ZXugicgn6U')
    <iframe
        width="400"
        height="300"
        src="https://www.youtube.com/embed/1ZXugicgn6U"
        frameborder="0"
        allowfullscreen
    ></iframe>

Since that point, there have been several “milestones” in conversational interfaces. This summary offers a timeline that actually starts with ELIZA, which we just met.

Before jumping ahead 65 years or so from “Audrey” and “Eliza,” you could reasonably be wondering why it seems that so many digital conversationalists are female. I’d point you to an article in the Atlantic “Why Do So Many Digital Assistants Have Feminine Names?” which sites everything from academic studies that we take orders or attend to warning messages when they are delivered with a female voice, to outright sexism. I’ve seen a couple articles suggest that instead “Genderless bots are the wave of the future”. These two articles are by no means meant to be representative of the writing on this. It is just hard not to see “Audrey” and “ELIZA” and “Alexa” and wonder.

Conversational bots are catching on in Journalism. The NYT had a significant project last year with Alexa, Quartz launched a Bot Studio producing Quackbot to help support their journalists workflow. And the platforms are making tools for creating bots easier and easier. Now, the heavy lifting of turning speech to text and text to speech is a commodity API call to Amazon’s Voice Service - meaning voice interfaces are ridiculously simple to implement.

If you think about the technology to make these systems work, the heavy lifting of speech recognition and “text-to-speech” generation have become cloud services.

The editorial decisions are still tough, but the underlying technology has come a long, long way. The scriptiness of this kind of bot is clearest in Alexa’s simple customization platform for your personal skills (apps). There are a collection of common choices - like information for your pet sitter.

Here you write out answers to questions a pet sitter might ask about dear Fido. What do I do in the morning? What does she need in the afternoon? Notice the skill is authored entirely in text. The cloud services will take care of making sure Alexa narrates your responses.

You’ll find bots on practically all of our information networks. On Slack, for example, you can head to api.slack.com to create your own bot.

In our Computational Journalism class in the J-School, we try out a couple of platforms. The overall process is more or less the same and amounts to learning a new API - How do we pass requests around? Where do we find answers?

This FastCompany article also offers a good history of the chatbot and how things are different today: How The New, Improved Chatbots Rewrite 50 Years Of Bot History. Chatbots are really a conversation-based interfaces to services of various kinds. Sometimes the logic behind their inner workings is incredibly complex, but other times their operation is very service-oriented and shallow. Sometimes they are reading from a script, sometimes machine learning helps direct responses.

The FastCompany article makes the point that while strands of artificial intelligence research has been obsessed with making a both that was believably human (or perhaps with the potential for one), the latest incarnations of these programs exist “to help you get things done.” They have grown plentiful using the scale of new platforms (Facebook, Twitter, and so on) and are fit tidily into their business interests.

Here’s a snippet.

But over the past few years, chatbots have made a comeback. With advancements in processing power, bots now have a better ability to interpret natural language and learn from users over time. Just as importantly, big companies like Facebook, Apple, and Microsoft are now eager to host our interactions with various services, and offer tools for developers to make those services available. Chatbots easily fit into their larger business models of advertising, e-commerce, online services, and device sales. Meanwhile, services that want to reach hundreds of millions of customers on a platform like Messenger will be helping to write the chat scripts.

“A lot of the things that were barriers to us back then are no longer barriers to us today because of the evolution of the way technology works,” Hoffer says.

Crucially, these bots are meant to be useful out of the gate, … they no longer need conversation as a crutch for mass adoption. Sure, Apple’s Siri knows how to break the ice with a few jokes, but it largely exists to help you get things done. Rival assistants from Google and Amazon don’t exhibit much personality at all. Utility is winning out because the technology allows for it.

The article ends with a comment about early artificial intelligence researcher Joseph Weizenbaum. Weizenbaum created something called ELIZA, a computer program that was modeled after a psychiatrist (or an “active listener”).

If the latest round of chatbots succeed, they might prove that Weizenbaum, the creator of ELIZA, was right all along. These machines are not warm and cuddly replacements for the human intellect. They’re just another set of tools—an evolution of the apps that have served us for years.

As an aside, Weizenbaum didn’t create ELIZA as a state of the art conversational program. He was, in fact, troubled by its positive reception, and later in life he wrote about the limits of artificial intelligence. The passage below is from his 1976 text Computer power and human reason. He closes the third chapter with this image.

Sometimes when my children were still little, my wife and I would stand over them as they lay sleeping in their beds. We spoke to each other only in silence, rehearsing a scene as old as mankind itself. It is as Ionesco told his journal: ‘Not everything is unsayable in words, only the living truth.

Beautiful, right? For a data class, it’s a great reminder that data will always exist at distance from lived experience. We can try to pile more and more data on a given situation or phenomenon. But no matter how big our data gets, we are still missing something. That’s why we’ve been stressing how your choice of data is a creative act.

Our dear friend Suman Deb Roy has listed out a number of identifiable elements to think about when you are designing a conversation. Again, not all of these will apply as we might be very functionally-oriented, but they are something to remember. The deeper the conversation, the harder it is to program and we begin to venture into AI or machine learning.

Element of Conversation Possible Techniques to Compute/ Quantify
1. Notifications/ Recalling relevant things Time Series Analysis, Alerting, Keyword caches
2. Learning topics in context Topic Mining/Modeling - extract the topic from the words in text
3. Understanding Social Networks (offline and online) Network Science, the study of the structure of how things are connected and how information flows through it
4. Responding to Emotion Sentiment Analysis
5. Having Episodic Memory Some kind of graphical model, see Aditi’s data post.
6. Portraying Personality Decision Tree, which is a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility.

All about (or a lot about… or some about) bots!

Today we wanted to give you a little overview of the kinds of bots that are circulating in the world, providing a taxonomy, if you will, of all the innovative work being done. But first, what is a bot?

We’ll draw mostly from botnerds.com and the article by Mark Sample. The former reference offers a practical definition…

Bots are software programs that perform automated, repetitive, pre-defined tasks. These tasks can include almost any interaction with software that has an API.

…while Mark Sample is more aspirational.

A computer program that reveals the injustice and inequality of the world and imagines alternatives. A computer program that says who’s to praise and who’s to blame. A computer program that questions how, when, who and why. A computer program whose indictments are so specific you can’t mistake them for bullshit. A computer program that does all this automatically.

And then of course, the State of California has defined a bot in it’s fairly recent bot legislation.

<img src=https://github.com/computationaljournalism/columbia2019/raw/master/images/u5.001.jpeg>

First, the practical. Our first reference divides bots into “Good” and “Bad” categories, which are interpreted largely in terms of their effect on our information ecosystem - functionally, adding or detracting.

  1. Good Bots
    • Chatbots “are designed to carry on conversations with humans, usually just for fun, and to test the limits of the technology.”
    • Crawlers “run continuously in the background, primarily fetch data from other APIs or websites, and are well-behaved in that they respect directives you give them”
    • Transactional bots act as agents on behalf of humans, and interact with external systems to accomplish a specific transaction, moving data from one platform to another.”
    • Informational bots “surface helpful information, often as push notifications, and are also called news bots.”
    • Art bots “are designed to be appreciated aesthetically.”
    • Game bots “game bots function as characters, often for humans to play against or to practice and develop skills…”
  2. Bad Bots
    • Hackers “distribute malware of all kinds”
    • Spammers “steal content (email addresses, images, text, etc) from other website”, often to republish it
    • Scrapers post “promotional content around the web, and ultimately drive traffic to the spammer’s website”
    • Impersonators “mimic natural user characteristics, making them hard to identify” (they cite political propadanda bots)

In terms of Bot Agency or Bot Intelligence, this framing presents examples along a spectrum - Script Bots, Smart Bots and Intelligent Agents. An interaction with a Script Bots, they write, is

based off of a pre-determined model (the “script”) that determines what the bot can and cannot do. The “script” is a decision tree where responding to one question takes you down a specific path, which opens up a new, pre-determined set of possibilities.

This is what we saw with ELIZA and Alexa. Upping the autonomy a little, Smart Bots have access to other APIs that expand the universe of responses.

Many bots have a heavy server-side processing component, which allows them access to massive computing power in understanding and responding to queries. Couple that with the open-sourcing of AI software libraries like TensorFlow, and you have the ingredients for some amazing human-bot interactions.

This category also allows for human-assisted interactions. The bot need not act alone, but can invoke human intelligence or even direct consultation, redirecting the interaction to a responsible human. Finally, the Intelligent Agent is meant to act autonomously.

If operating correctly, they should require no human intervention in order to perform their tasks correctly. Google’s self-driving cars are designed without steering wheels for humans, because they shouldn’t be necessary. x.ai has a bot that schedules meetings for you, Amy Ingram, and she manages all the back-and-forth with zero oversight.

Mark Sample provides a different, less practical characterization of bots, one drawn more from literary studies (where bots have been an object of fascination for some time). He focuses on one particular kind of bot (primarily active on Twitter) that he terms “Protest Bots” or “Bots of Conviction”. Sample says they share at least five characteristics:

  • Topical - “They are about the morning news — and the daily horrors that fail to make it into the news.”
  • Data-based - “They don’t make this [stuff] up. They draw from research, statistics, spreadsheets, databases.”
  • Cumulative - It is the nature of bots to do the same thing over and over again, with only slight variation… The repetition builds on itself, the bot relentlessly riffing on its theme, unyielding and overwhelming, a pile-up of wreckage on our screens.”
  • Oppositional - “Bots of conviction challenge us to consider our own complicity in the wrongs of the world.”
  • Uncanny. - “Protests bots often reveal something that was hidden; or conversely, they might purposefully obscure something that had been in plain sight.”

The examples of Protest Bots that Sample introduces are often journalistic, but often more in the realm of advocacy. Still, the examples open up the potential to the kinds of projects or actions that can be taken outside the more functional description of our first reference.

%%HTML
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">The next person to be executed in Ohio is Cleveland Jackson in 3 months, 8 days, 22 hours and 13 minutes. <a href="https://t.co/uD8HuiZIfM">https://t.co/uD8HuiZIfM</a></p>&mdash; The Next To Die (@thenexttodie) <a href="https://twitter.com/thenexttodie/status/1098247685386264576?ref_src=twsrc%5Etfw">February 20, 2019</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Twitter bots

We are going to use the Twitter API (Application Programming Interface) to create our Twitter bots. An API is, as its name suggests, is a framework for making use of some service. Alexa’s voice service is exposed through an API, a Slackbot would depend on an API. And with Twitter’s API you can cull information about users (their followers and so on) or search for tweets or update your own status.

To access the Twitter API, we need to register an “application” that will be pulling data from their service. This means that in one sweet instant you will become a developer! 😮 The steps are pretty easy and listed below. You’ll first need to get a set of “keys” to use the API and then install a Python library that exposes the Twitter API through special objects.

A) Apply for a Twitter Developer Account

If you don’t already have credentials for Twitter, you have to create apply for a developer account, create an application and then generate a set of keys (an API key, API secret, Access token and Access token secret) on the Twitter developer site. First, we need to apply for an account:

  1. Create a Twitter user account if you do not already have one.
  2. Go to https://developer.twitter.com/ and log in with your Twitter user account.
  3. After you’ve logged in, you need to “Apply” for a developer account. You can do that here: https://developer.twitter.com/en/apply-for-access. A few tips when Applying for your developer account:
  • On the “Account Details” section, you can select “I am requesting access for my own personal use.”
  • On the “Tell us about your project” section, you can select: “Student project / Learning to code.” In the “Describe in your own words what you are building” section, let them know you’ll be using the API in class. Do you best to fill this part out and let us know if you need help!
  • The last step is to confirm your email. Once you do this, your application will be “under review” by the Twitter team

Important: At this point, you may have to wait for Twitter to review and approve your account. In some cases, your application will be approved immediately. Once you are approved, follow the next steps to create an application and generate your API “keys.”

B) Get Your API Keys

Once your application is approved:

  1. Go to https://developer.twitter.com/en/apps and click “Create an app”
  2. Fill out the form, agree to the terms, and click the “create” button. When filling out the form, make sure you put information in the required fields. For URL, you can use https://columbia.edu
  3. Once you’ve created your app, click on “Keys and tokens” tab and copy your “API key” and “API secret key”. Scroll down to the “Access token & access token secret” and click “create” - copy your “Access token” and “Access token secret”.

Once you have your tokens, copy them into the variables below. If you don’t have yours, you can borrow some on a temporary basis (they will be shut down after this session). You can find a spreadsheet here. Mark an x in the first column and try to keep an even number of people using the same credentials.

# Insert your own keys and secrets here...
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
ACCESS_TOKEN = ""
ACCESS_TOKEN_SECRET = ""

C) The Tweepy Library

The developer community has created hundreds of Twitter libraries that help you access Twitter’s API. By “help” we mean they have created objects that hide the details of making requests for data from Twitter, and leave you with a clean coding interface. Your requests to Twitter are in the form of neat methods (verbs) that return data on users, their statuses and followers. You can even post tweets using these libraries.

We will by using Tweepy to call the Twitter API. Why? It has many of the best features of the other libraries and its documentation is complete. Often, free software projects can be thinly documented, leaving you a little out to sea if you have a problem.

Keep these two links open in tabs as we go through the code below: Tweepy documentation and source code.

# before we can make Twitter API calls, we need to initialize a few things...
from tweepy import OAuthHandler, API

# setup the authentication
auth = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)

# create an object we will use to communicate with the Twitter API
api = API(auth)

This object has methods that encapsulate all the functionlity of the Twitter API. You can follow or unfollow people, you can post tweets, you can pull an accounts follower or friends. All of these are “methods” of the api object. It exposes all the activities available through the Twitter API.

So from the comfort of Python we can make extensive use of Twitter.

Getting a User’s Profile Info

OK, now you are prepped and ready to start making Twitter API calls. First, lets look at some user profiles.

We will be calling the users/show API. It is documented by Twitter here.

To call the user/show API, Tweepy has a corresponding method called get_user().

# get a user's profile ('myoung' in this case)
user = api.get_user('myoung')

type(user)
tweepy.models.User

What sort of information do we get about a user? Take a look at the user/show documentation to see what Twitter returns. By calling api.get_user() above, the Tweepy library made an API call to Twitter. The result of the API call is technically a JSON string. We could parse it into primitive Python objects like lists and dictionaries and numbers and strings.

Tweepy does this work for us and stores it in an attribute ._json. Let’s have a look at all the goodies we can learn about myoung. (Again, we are not print()ing this object because, like DataFrames, the notebook is going to format the output nicely.)

What kind of object are we dealing with?

data = user._json
data
{'contributors_enabled': False,
 'created_at': 'Thu Jul 20 18:35:41 +0000 2006',
 'default_profile': False,
 'default_profile_image': False,
 'description': 'director of machine learning eng @ nytimes, adjunct at columbia j-school (brown institute)',
 'entities': {'description': {'urls': []}},
 'favourites_count': 7506,
 'follow_request_sent': False,
 'followers_count': 4345,
 'following': False,
 'friends_count': 795,
 'geo_enabled': True,
 'has_extended_profile': False,
 'id': 2671,
 'id_str': '2671',
 'is_translation_enabled': False,
 'is_translator': False,
 'lang': None,
 'listed_count': 222,
 'location': 'Brooklyn, NY',
 'name': 'Michael Young',
 'notifications': False,
 'profile_background_color': '828B8C',
 'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
 'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
 'profile_background_tile': False,
 'profile_banner_url': 'https://pbs.twimg.com/profile_banners/2671/1398212387',
 'profile_image_url': 'http://pbs.twimg.com/profile_images/953820274390007808/vI1l_nE6_normal.jpg',
 'profile_image_url_https': 'https://pbs.twimg.com/profile_images/953820274390007808/vI1l_nE6_normal.jpg',
 'profile_link_color': '0000FF',
 'profile_location': {'attributes': {},
  'bounding_box': None,
  'contained_within': [],
  'country': '',
  'country_code': '',
  'full_name': 'Brooklyn, NY',
  'id': '011add077f4d2da3',
  'name': 'Brooklyn, NY',
  'place_type': 'unknown',
  'url': 'https://api.twitter.com/1.1/geo/id/011add077f4d2da3.json'},
 'profile_sidebar_border_color': '363734',
 'profile_sidebar_fill_color': 'CACDC3',
 'profile_text_color': '000000',
 'profile_use_background_image': False,
 'protected': False,
 'screen_name': 'myoung',
 'status': {'contributors': None,
  'coordinates': None,
  'created_at': 'Thu May 21 19:24:49 +0000 2020',
  'entities': {'hashtags': [],
   'symbols': [],
   'urls': [],
   'user_mentions': [{'id': 1703088440,
     'id_str': '1703088440',
     'indices': [0, 10],
     'name': 'dan fallon',
     'screen_name': 'da_fallon'},
    {'id': 35773039,
     'id_str': '35773039',
     'indices': [11, 23],
     'name': 'The Atlantic',
     'screen_name': 'TheAtlantic'}]},
  'favorite_count': 1,
  'favorited': False,
  'geo': None,
  'id': 1263551336890740738,
  'id_str': '1263551336890740738',
  'in_reply_to_screen_name': 'da_fallon',
  'in_reply_to_status_id': 1262800453462622212,
  'in_reply_to_status_id_str': '1262800453462622212',
  'in_reply_to_user_id': 1703088440,
  'in_reply_to_user_id_str': '1703088440',
  'is_quote_status': False,
  'lang': 'en',
  'place': None,
  'retweet_count': 0,
  'retweeted': False,
  'source': '<a href="https://mobile.twitter.com" rel="nofollow">Twitter Web App</a>',
  'text': '@da_fallon @TheAtlantic Huge congrats!',
  'truncated': False},
 'statuses_count': 8979,
 'time_zone': None,
 'translator_type': 'none',
 'url': None,
 'utc_offset': None,
 'verified': False}

Now, using the data Python object, pull some information about Mike from this dictionary.

  1. What is his location?
  2. What his his description?
  3. When did he last tweet?
  4. What was the text of his tweet?
  5. How many followers does he have?
# Your code here

data["followers_count"]
4345

Tweepy also uses the high-level User object returned by .get_user() that results from the API call to store this information in a more convenient format – as attributes of the object. Here we have .id and .screen_name and the date Mike joined Twitter.

# let's print out a few attributes for our user
print(user.id)
print(user.screen_name)
print(user.location)
print(user.followers_count)
print(user.listed_count)
print(user.statuses_count)
print(user.created_at)
2671
myoung
Brooklyn, NY
4345
222
8979
2006-07-20 18:35:41

Alright, so to sum. Twitter has an API. We make requests and get back a JSON string. Packages like Tweepy work with that string. We’ve seen a simple translation into Python objects using the ._json attribute and we’ve seen the object Tweepy creates that has special attributes for characteristics of a user. Basically, making an object that is easier to work with than the raw dictionary.

Send a Tweet!

If you were writing a bot, it would need to tweet! You can send out a tweet with one line of code.

We will be using the statuses/update API to send the tweet. Again, like all of Twitters API functionality, it has documentation and you can read about posting status updates here.

# send a tweet!
# you may want to modify this message before you send it

api.update_status(status='Sending my first tweet via the Twitter API - Thanks @BrownInstitute!')
Status(_api=<tweepy.api.API object at 0x7fa8b04935c0>, _json={'created_at': 'Tue May 26 17:02:02 +0000 2020', 'id': 1265327344635596801, 'id_str': '1265327344635596801', 'text': 'Sending my first tweet via the Twitter API - Thanks @BrownInstitute!', 'truncated': False, 'entities': {'hashtags': [], 'symbols': [], 'user_mentions': [{'screen_name': 'BrownInstitute', 'name': 'The Brown Institute', 'id': 607245696, 'id_str': '607245696', 'indices': [52, 67]}], 'urls': []}, 'source': '<a href="http://journalism.columbia.edu" rel="nofollow">myapsthing</a>', 'in_reply_to_status_id': None, 'in_reply_to_status_id_str': None, 'in_reply_to_user_id': None, 'in_reply_to_user_id_str': None, 'in_reply_to_screen_name': None, 'user': {'id': 896439987280982016, 'id_str': '896439987280982016', 'name': 'mhansen5', 'screen_name': 'Mh328755', 'location': '', 'description': '', 'url': None, 'entities': {'description': {'urls': []}}, 'protected': False, 'followers_count': 0, 'friends_count': 1, 'listed_count': 0, 'created_at': 'Sat Aug 12 18:35:22 +0000 2017', 'favourites_count': 0, 'utc_offset': None, 'time_zone': None, 'geo_enabled': False, 'verified': False, 'statuses_count': 6, 'lang': None, 'contributors_enabled': False, 'is_translator': False, 'is_translation_enabled': False, 'profile_background_color': 'F5F8FA', 'profile_background_image_url': None, 'profile_background_image_url_https': None, 'profile_background_tile': False, 'profile_image_url': 'http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', 'profile_image_url_https': 'https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', 'profile_link_color': '1DA1F2', 'profile_sidebar_border_color': 'C0DEED', 'profile_sidebar_fill_color': 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': False, 'default_profile': True, 'default_profile_image': True, 'following': False, 'follow_request_sent': False, 'notifications': False, 'translator_type': 'none'}, 'geo': None, 'coordinates': None, 'place': None, 'contributors': None, 'is_quote_status': False, 'retweet_count': 0, 'favorite_count': 0, 'favorited': False, 'retweeted': False, 'lang': 'en'}, created_at=datetime.datetime(2020, 5, 26, 17, 2, 2), id=1265327344635596801, id_str='1265327344635596801', text='Sending my first tweet via the Twitter API - Thanks @BrownInstitute!', truncated=False, entities={'hashtags': [], 'symbols': [], 'user_mentions': [{'screen_name': 'BrownInstitute', 'name': 'The Brown Institute', 'id': 607245696, 'id_str': '607245696', 'indices': [52, 67]}], 'urls': []}, source='myapsthing', source_url='http://journalism.columbia.edu', in_reply_to_status_id=None, in_reply_to_status_id_str=None, in_reply_to_user_id=None, in_reply_to_user_id_str=None, in_reply_to_screen_name=None, author=User(_api=<tweepy.api.API object at 0x7fa8b04935c0>, _json={'id': 896439987280982016, 'id_str': '896439987280982016', 'name': 'mhansen5', 'screen_name': 'Mh328755', 'location': '', 'description': '', 'url': None, 'entities': {'description': {'urls': []}}, 'protected': False, 'followers_count': 0, 'friends_count': 1, 'listed_count': 0, 'created_at': 'Sat Aug 12 18:35:22 +0000 2017', 'favourites_count': 0, 'utc_offset': None, 'time_zone': None, 'geo_enabled': False, 'verified': False, 'statuses_count': 6, 'lang': None, 'contributors_enabled': False, 'is_translator': False, 'is_translation_enabled': False, 'profile_background_color': 'F5F8FA', 'profile_background_image_url': None, 'profile_background_image_url_https': None, 'profile_background_tile': False, 'profile_image_url': 'http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', 'profile_image_url_https': 'https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', 'profile_link_color': '1DA1F2', 'profile_sidebar_border_color': 'C0DEED', 'profile_sidebar_fill_color': 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': False, 'default_profile': True, 'default_profile_image': True, 'following': False, 'follow_request_sent': False, 'notifications': False, 'translator_type': 'none'}, id=896439987280982016, id_str='896439987280982016', name='mhansen5', screen_name='Mh328755', location='', description='', url=None, entities={'description': {'urls': []}}, protected=False, followers_count=0, friends_count=1, listed_count=0, created_at=datetime.datetime(2017, 8, 12, 18, 35, 22), favourites_count=0, utc_offset=None, time_zone=None, geo_enabled=False, verified=False, statuses_count=6, lang=None, contributors_enabled=False, is_translator=False, is_translation_enabled=False, profile_background_color='F5F8FA', profile_background_image_url=None, profile_background_image_url_https=None, profile_background_tile=False, profile_image_url='http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', profile_image_url_https='https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', profile_link_color='1DA1F2', profile_sidebar_border_color='C0DEED', profile_sidebar_fill_color='DDEEF6', profile_text_color='333333', profile_use_background_image=True, has_extended_profile=False, default_profile=True, default_profile_image=True, following=False, follow_request_sent=False, notifications=False, translator_type='none'), user=User(_api=<tweepy.api.API object at 0x7fa8b04935c0>, _json={'id': 896439987280982016, 'id_str': '896439987280982016', 'name': 'mhansen5', 'screen_name': 'Mh328755', 'location': '', 'description': '', 'url': None, 'entities': {'description': {'urls': []}}, 'protected': False, 'followers_count': 0, 'friends_count': 1, 'listed_count': 0, 'created_at': 'Sat Aug 12 18:35:22 +0000 2017', 'favourites_count': 0, 'utc_offset': None, 'time_zone': None, 'geo_enabled': False, 'verified': False, 'statuses_count': 6, 'lang': None, 'contributors_enabled': False, 'is_translator': False, 'is_translation_enabled': False, 'profile_background_color': 'F5F8FA', 'profile_background_image_url': None, 'profile_background_image_url_https': None, 'profile_background_tile': False, 'profile_image_url': 'http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', 'profile_image_url_https': 'https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', 'profile_link_color': '1DA1F2', 'profile_sidebar_border_color': 'C0DEED', 'profile_sidebar_fill_color': 'DDEEF6', 'profile_text_color': '333333', 'profile_use_background_image': True, 'has_extended_profile': False, 'default_profile': True, 'default_profile_image': True, 'following': False, 'follow_request_sent': False, 'notifications': False, 'translator_type': 'none'}, id=896439987280982016, id_str='896439987280982016', name='mhansen5', screen_name='Mh328755', location='', description='', url=None, entities={'description': {'urls': []}}, protected=False, followers_count=0, friends_count=1, listed_count=0, created_at=datetime.datetime(2017, 8, 12, 18, 35, 22), favourites_count=0, utc_offset=None, time_zone=None, geo_enabled=False, verified=False, statuses_count=6, lang=None, contributors_enabled=False, is_translator=False, is_translation_enabled=False, profile_background_color='F5F8FA', profile_background_image_url=None, profile_background_image_url_https=None, profile_background_tile=False, profile_image_url='http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', profile_image_url_https='https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png', profile_link_color='1DA1F2', profile_sidebar_border_color='C0DEED', profile_sidebar_fill_color='DDEEF6', profile_text_color='333333', profile_use_background_image=True, has_extended_profile=False, default_profile=True, default_profile_image=True, following=False, follow_request_sent=False, notifications=False, translator_type='none'), geo=None, coordinates=None, place=None, contributors=None, is_quote_status=False, retweet_count=0, favorite_count=0, favorited=False, retweeted=False, lang='en')

As we said, through the API, you can do anything through Python that you could do via your Twitter interface. So, you can tweet, you can make friends, you can send a direct message, you can read your direct messages… the works!

Look at a User’s Tweets

Now, let’s look at @realDonaldTrump’s tweets. If you’ve had enough of all that, replace it with @justinbieber or someone less anxious-making.

We will use the statuses/user_timeline API to do this. Read the documentation here. Essentially it returns tweets in reverse chronological order – newest first.

# get the realDonaldTrump last 10 tweets
tweets = api.user_timeline(screen_name='realDonaldTrump', count=10)

# what sort of object do we get?
print(type(tweets))
<class 'tweepy.models.ResultSet'>

The class here is a ResultSet. It’s just like a list. So you can ask how many tweets we have…

len(tweets)
10

… or ask for the sixth one (remember we start counting at 0). Just like the user object we made, let’s look at one of his tweets…

tweet = tweets[5]
type(tweet)
tweepy.models.Status

OK a Status object. Like the User object, we can pull raw data corresponding to Trump’s sixth tweet using the ._json attribute of this object.

tweet._json
{'contributors': None,
 'coordinates': None,
 'created_at': 'Tue May 26 13:19:17 +0000 2020',
 'entities': {'hashtags': [],
  'symbols': [],
  'urls': [{'display_url': 'twitter.com/i/web/status/1…',
    'expanded_url': 'https://twitter.com/i/web/status/1265271286789558273',
    'indices': [117, 140],
    'url': 'https://t.co/wNcYHAJRJb'}],
  'user_mentions': []},
 'favorite_count': 37960,
 'favorited': False,
 'geo': None,
 'id': 1265271286789558273,
 'id_str': '1265271286789558273',
 'in_reply_to_screen_name': 'realDonaldTrump',
 'in_reply_to_status_id': 1265271275007721472,
 'in_reply_to_status_id_str': '1265271275007721472',
 'in_reply_to_user_id': 25073877,
 'in_reply_to_user_id_str': '25073877',
 'is_quote_status': False,
 'lang': 'en',
 'place': None,
 'retweet_count': 9607,
 'retweeted': False,
 'source': '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>',
 'text': '....about whether or not Joe could have done such a horrible thing? Maybe or maybe not, but I find Joe to be a tota… https://t.co/wNcYHAJRJb',
 'truncated': True,
 'user': {'contributors_enabled': False,
  'created_at': 'Wed Mar 18 13:46:38 +0000 2009',
  'default_profile': False,
  'default_profile_image': False,
  'description': '45th President of the United States of America🇺🇸',
  'entities': {'description': {'urls': []},
   'url': {'urls': [{'display_url': 'Instagram.com/realDonaldTrump',
      'expanded_url': 'http://www.Instagram.com/realDonaldTrump',
      'indices': [0, 23],
      'url': 'https://t.co/OMxB0x7xC5'}]}},
  'favourites_count': 4,
  'follow_request_sent': False,
  'followers_count': 80285171,
  'following': False,
  'friends_count': 46,
  'geo_enabled': True,
  'has_extended_profile': False,
  'id': 25073877,
  'id_str': '25073877',
  'is_translation_enabled': True,
  'is_translator': False,
  'lang': None,
  'listed_count': 113648,
  'location': 'Washington, DC',
  'name': 'Donald J. Trump',
  'notifications': False,
  'profile_background_color': '6D5C18',
  'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
  'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
  'profile_background_tile': True,
  'profile_banner_url': 'https://pbs.twimg.com/profile_banners/25073877/1583212785',
  'profile_image_url': 'http://pbs.twimg.com/profile_images/874276197357596672/kUuht00m_normal.jpg',
  'profile_image_url_https': 'https://pbs.twimg.com/profile_images/874276197357596672/kUuht00m_normal.jpg',
  'profile_link_color': '1B95E0',
  'profile_sidebar_border_color': 'BDDCAD',
  'profile_sidebar_fill_color': 'C5CEC0',
  'profile_text_color': '333333',
  'profile_use_background_image': True,
  'protected': False,
  'screen_name': 'realDonaldTrump',
  'statuses_count': 52024,
  'time_zone': None,
  'translator_type': 'regular',
  'url': 'https://t.co/OMxB0x7xC5',
  'utc_offset': None,
  'verified': True}}

So we can pull out tweet["created_at"] to get the time of the tweet and so on.

Like the user profile in a User object, the Status object contains information like the text of Trump’s tweet, say retweet count and so on. Here is some basic information about Trump’s most recent tweet. This is stored under index 0 in the list of tweets we fetched from Twitter.

# select one of the 10 tweets, here the first (most recent) one
tweet = tweets[0]

# print out some of the data associated with the "status" object
# remember our "dot" notation for accessing data and functionality
print(tweet.text)
print(tweet.created_at)
print(tweet.retweet_count)
print(tweet.source)
How brilliant are our FARMERS? Thank you @lgutwein99_31, real talent! #MAGA https://t.co/mtzbqUFd1V
2020-05-26 15:48:33
9225
Twitter for iPhone

There is a lot you can do with the Twitter API. Not only can you get user’s profiles or get their latest tweets - you can also use the API to search for various phrases, keywords, hashtags, etc. For example, if you want to search for Tweets that contain the #IowaCaucuses2020 hashtag:

tweets = api.search("#COVID19")
print("We pulled",len(tweets),"tweets.\nHere is one:\n")

tweet = tweets[7]
print(tweet.text)
We pulled 15 tweets.
Here is one:

RT @IRIglobal: The #CCP has tried to use a charm offensive around #COVID19 to bolster its support in Africa. 

But as @IRIglobal's @AdamGeo…

So, we have most of the ingredients for a bot. We can post a tweet, we can (thank you, Python) assemble data from a source and take action (a notification bot) or we can tweet content at a regular pace (a bot to inform). For a conversational bot, we need one more API feature - scanning tweets in realtime, looking for specific hashtags or keywords or login names.

from tweepy import StreamListener, Stream

#1. Create A Stream Listener. 
#   Here we override tweepy.StreamListener to add logic to on_status
class myStreamListener(StreamListener):
    
    def on_status(self, status):
        
        print(status.user.screen_name)
        print(status.text)
        print("=============")

        # api.update_status("Hello "+status.user.screen_name)

#2. Create a stream
#   This will involve your authentication again
myStreamListener = myStreamListener()
myStream = Stream(auth = api.auth, listener=myStreamListener)

#3. Start listening
#.  Here we use "track=" to provide a list of terms to listen for
myStream.filter(track=["@cocteau"])
PaulMas38289273
@evs490 @JStigev @MetsOfficials @jack @realDonaldTrump He is a political opponent of someone DT supports.  

Political opponent by proxy.
=============
DrumpfForJail
@realDonaldTrump
=============
van_essavan
RT @SexCounseling: @Lrihendry @ROHLL5 @RealDeanCain @hdbradko @realDonaldTrump We have a recalling campaign started in California, hopefull…
=============
KJU2013
RT @MiaFarrow: @realDonaldTrump You have told us 18,000+ lies. Your advice is as dangerous as the example you set. Your Covid response was…
=============
cueball26561673
Just a bunch of crooks led by top dog Chrisie Wray , right @KerriKupecDOJ &amp; @realDonaldTrump .
=============
SenLauraWoods
RT @ACTBrigitte: The Transition to Greatness is starting NOW! 

Thank you, @realDonaldTrump!
=============
Viky66jane
RT @Gilas79201942: @ItalyQanons @matteosalvinimi @LegaSalvini @GiorgiaMeloni @FLOTUS @CesareSacchetti @a_meluzzi @realDonaldTrump @ViKu1111…
=============
kathrynleehane
@realDonaldTrump No amount of tweeting will distract us from the fact that you have the blood of 100,000 Americans… https://t.co/jKBtWK0utH
=============
karenjo14026204
RT @soloyochapin: @briantylercohen @realDonaldTrump No other president in American history has been WORSE that inept @realDonaldTrump at ha…
=============
3pawpundit
@ScottFordInOhio @FloridaGirlCubs @realDonaldTrump Exactly.  If I don't like reading someone's tweets, I just unfol… https://t.co/AHLhr83K4A
=============
Mik61016120
@AndyOstroy @realDonaldTrump So did yours
=============
JMBossert1
@BlueFemmeNWF @sunnynash @realDonaldTrump What they should hire is a baby sitter.
=============
seabeereserve
@CatOfTheCanalss @SoCaleniw @dolfan650 @glamelegance @realDonaldTrump @lgutwein99_31 Lmao no sweetheart. Dumb peopl… https://t.co/Yqau8HMiM2
=============
jojake111
RT @DougMas35638355: @realDonaldTrump https://t.co/0cUdNTBnlP
=============
F00BAD00
RT @SidneyPowell1: HUGE and important read!! by @jsolomonReports 
@realDonaldTrump 
@GenFlynn 
@BarbaraRedgate 
@dbongino 
@JosephJFlynn1…
=============
MaryMargaretTK
RT @inittowinit007: Translation:  
🔥OPPORTUNITY FOR THE NEW WORLD ORDER!🔥
If you enjoyed the last few months of  restricted life and losing…
=============
Marquet44414464
RT @DeAnna4Congress: @brithume @realDonaldTrump Someone explain to me how wearing a MASK while sitting on a beach a few feet away from the…
=============
GBMervue
RT @PakiCabDriver: @Politidope Are we talking about the Orange Orangutan @realDonaldTrump’s mental health? He is a goner man https://t.co/e…
=============
susan_z_kat
RT @BibleBeltDarlin: WARNING: I hope you realize that if mail-in ballots are not ended and stopped, your vote won’t count and the Democrats…
=============
traubi001
RT @madamecrab: @ECLMiller Think about it. .@realDonaldTrump WEARS MAKEUP. Every day. Can you imagine if ANY Democrat did that? 

#MostUnma…
=============
Booth62240818
RT @KathrynJoans: @Chriscarts31 @SexCounseling @realDonaldTrump Let me see, we can only tweet what you agree with, is that right?  If the h…
=============
Crazy7_Havoc7
Wow, Really? 🥴 @POTUS @realDonaldTrump @PatriotsSoapbox @VerumRadix @BWDeadcat @Tetsuyama511 @RedPillKen @PressSec… https://t.co/2IDxL8Nra9
=============
LetsWorkTogeth3
@JNototrump @Pauliwallnutz @nicolemchapman @gtconway3d @realDonaldTrump Typical SOP of the ignorant.  Refuse to loo… https://t.co/Ns5KUZDbZH
=============
KayeWeb03522569
@realDonaldTrump Then WTF is the purpose of the National Stockpile or even a federal government if in situations of… https://t.co/JefkxhBWrd
=============
itsskitime
@dpk714 @GerryCallahan @realDonaldTrump I get it you don’t like the President. That’s your prerogative. For me ther… https://t.co/KpF6jmpWDw
=============
NoneOfy88049470
@GeraldoRivera @realDonaldTrump Why should he wear mask to protect you from name calling?

#ridiculousness
=============
Mpalm09
RT @Chicago1Ray: @realDonaldTrump This graph could shed some light as to why Governor @GavinNewsom wants mail in ballots, Democrats lose Ca…
=============
DianaFitz2
RT @RepDougCollins: By deeming churches essential, @realDonaldTrump is standing for our Constitutional rights.
 
We need to open our church…
=============
MaraPad62943647
RT @Freedom___1776: @pantomath__ @Kathiec14 @realDonaldTrump https://t.co/ySItL2KKLi
=============
Laureen45130612
@VoteBlueNov3rd @realDonaldTrump That's #chinawohanvirus you IDIOT. #ChinaLiedAndPeopleDied #ChinaVirus
=============
laing_josie
@realDonaldTrump since when was looking good a logical valuation?!!
=============
snudpuckle
RT @politicallands1: @realDonaldTrump I'm trying to imagine how your words look to the grieving. https://t.co/wKXNAof1N6
=============
redm0323131123
RT @TaxReformExpert: If your state is still closed and the economy is in shambles, don’t blame President @realDonaldTrump.

Blame your Gove…
=============
Belinda72089059
RT @MelissaMcCray11: @SexCounseling @realDonaldTrump Exactly! He could cure cancer and they’d still cry and complain!
=============
SimakowiczAlma
@realDonaldTrump Keep feeding that meat to your followers. Since they don't wear masks or socially distance there w… https://t.co/MXEl1GD709
=============
JamesMcGov1982
@realDonaldTrump 😂🤡🟠
=============
d_teri1
@Nevada7desert @realDonaldTrump True!!!
=============
flpdcp
@realDonaldTrump You lie!
=============
KevinGromley
@realDonaldTrump You did NOT shut down travel from China early.  

You prohibited Chinese nationals &amp; other foreign… https://t.co/hMpbcXqamY
=============
GailSegreto
@realDonaldTrump Yes.. you made governors look good... only by comparison with how badly you have performed.  There… https://t.co/F21RbcNnuU
=============
cultcommoncore
@realDonaldTrump @lgutwein99_31 Beautiful!
I like that they caught the last bit of the Trump 2020 being created.
LO… https://t.co/h5TZ7SYPR5
=============
pmfeline66
@smoked0gg @CarolynjeanJen1 @realmayalani @ErrolWebber @realDonaldTrump @HHSGov @WhiteHouse @PressSec Also, how doe… https://t.co/nyCYpn8nEH
=============
hoops_bill
@OldSoldier999 @BurgessOwens @realDonaldTrump @BarackObama Just call me Drago!
=============
qanon37
RT @IrmaBel53130008: 🇺🇸VOTER FRAUD IS EVERYWHERE 🇺🇸STOP VOTER FRAUD🇺🇸DEMAND  VOTER ID 🇺🇸AND VOTER REFORM 🇺🇸End more registered voters than…
=============
princessdee333
RT @dwilliams54ca: ⁦@DonaldJTrumpJr⁩ ⁦@realDonaldTrump⁩ https://t.co/o77JtkHWmZ
=============
ricecheck1
@realDonaldTrump All you have to do is look at the objective data. We’ve (you)  handled this worse than any industr… https://t.co/ixEUwCDt0I
=============
HeaHenriquea
¿Quien le va a quitar en Colombia el poder político y militar a los narcotraficantes? ya tienen controlen todas las… https://t.co/wDVZ35Ami9
=============
uvasg03
@realDonaldTrump @lgutwein99_31 https://t.co/JLLCVwOiML
=============
lyineyes57
RT @michaelbeatty3: It's Tuesday,  months later...
and STILL no one has asked ms 🐦AZ🌵 what she meant by this 👇👇 https://t.co/jWavHInUr5
=============
KMScott18
RT @Jali_Cat: 😔7 days before JFK was assassinated...

“There's a plot in this country to enslave every man, woman &amp; child. Before I leave t…
=============
ShobaPfaff
RT @tedlieu: Today is Tuesday. That means @realDonaldTrump is lying, again. Dems were writing pandemic legislation in February while @POTUS…
=============
MTU85BSEE
@realDonaldTrump https://t.co/tQ8tUE3bAj
=============
superpenguin17
RT @DrDenaGrayson: ‼️As @realDonaldTrump whines about #NorthCarolina's hosting of the Republican National Convention, #NC officials reporte…
=============
Garron75453751
@kizer_fran @thejtlewis @realDonaldTrump Uh oh someone didn’t come up with a good comeback to facts and logic
=============
sdkid2
RT @JudicialWatch: "Impeachment of President @realDonaldTrump was to protect #Biden from being investigated over his Burisma dealings. Is A…
=============
JeanninePayne15
RT @BradMossEsq: To be clear: TWITTER is apologizing to the family of Lori Klausutis.

Not @realDonaldTrump 

Not @DonaldJTrumpJr 

Not @Iv…
=============
Harryjsch
All these DEMOCRATS were FOR the Wall.
Then PRESIDENT Trump was elected.
=============
JohnHP8220
RT @Brialalexi: ➕🔱🇺🇸 People are now policing, others. Running them out if grocery stores. Ppl getting paid 15-18$ an hr to be Covid19 Trace…
=============
Kathlee43210068
@realDonaldTrump Doesn’t matter if it wasn’t an original thought. You are the POTUS. the buck stops with you
=============
HighRawMama
RT @GovKemp: With world-class facilities, restaurants, hotels, and workforce, Georgia would be honored to safely host the Republican Nation…
=============
MangusColorado
RT @IrachadJohn: @MazurikL @TrumpsGAGirl @realDonaldTrump It was said, 1.5 million or was it billions was spent, (taxpayer money) on the Ob…
=============
pat34153951
RT @ProjectLincoln: Instead of focusing on the greatest crisis since the Great Depression, how is @realDonaldTrump spending his time? 

Sul…
=============
rstorms123
See? @realDonaldTrump
=============
LouiseLvers
@realDonaldTrump You fucked up. Still.
=============
mikeypeters
@JohnKStahlUSA @realDonaldTrump @TwitterSupport @Twitter @jack 
It's well past time to shutter the @realDonaldTrump… https://t.co/D9QcHiGGF3
=============
CathleenBurto13
RT @BrianKarem: From a D.C. area doctor: "If they're lifting the lockdown it doesn't mean the pandemic is over - it means they have room fo…
=============
Timpositive
@GOPChairwoman @realDonaldTrump Just keep lying... in your own feces
=============
bernitamichele
RT @ClimaxLady: @mmpadellan @realDonaldTrump https://t.co/TFPFHX1XWr
=============
Achatezwilly
@CaslerNoel @Tribble_lover @realDonaldTrump Donald Trump deserves the Death penalty.
=============
MoniSantomauro
@StewartTC @WhiteHouse @realDonaldTrump Thank you very much for saying that. It has been on my mind since US Navy C… https://t.co/vQAe2NYYJ2
=============
DanielMcCusker1
RT @Truth_Truth_Now: @RoseWilson1977 @gtconway3d @realDonaldTrump #TrumpGate The only "transition to greatness" this country will ever see…
=============
nanad23767483
@realDonaldTrump Tell that to the families of the dead.
=============
Dave_Kotlan
@TravisT66432033 @JuliaHa68553652 @MarciaSherman17 @funder @realDonaldTrump That's just a complaint, bot-boy (joine… https://t.co/YMuzjmrlGI
=============
micheleb801
RT @Jnb928: @realDonaldTrump Once you're GONE! https://t.co/alRqqfRCFX
=============
NanaOxford
RT @_ThePlanWeTrust: Look at this insane demon .@HillaryClinton and her little media buddy .@maddow wanting China to back the Democrats. Ma…
=============
amayzing_greyce
@RoydYure @TimeToSayGood15 @rightNtruthMat @realDonaldTrump https://t.co/Cf59JgLV7J
=============
click4it2day
@realDonaldTrump Somebody needs to delete Every post this crazy president has ever tweeted! Time to stand up for America Twitter!!!
=============
GrandmaShark18
RT @ProjectLincoln: Instead of focusing on the greatest crisis since the Great Depression, how is @realDonaldTrump spending his time? 

Sul…
=============
jaap_veldhorst
@shortiblue84 @ProgressPotato @JulianSvendsen @realDonaldTrump Like what happened when Trump was elected?
=============
FredBarton1899
RT @tedlieu: Today is Tuesday. That means @realDonaldTrump is lying, again. Dems were writing pandemic legislation in February while @POTUS…
=============
LisaG71102
@HillaryClinton Why are you not gone yet ? We don't need to hear your fake news . We know what was on Anthony wiene… https://t.co/z0mubQ4WXQ
=============
tronrud_linda
RT @AnthemRespect: Nothing could possibly go wrong here???

.@realDonaldTrump is right

Man finds 83 ballots shipped to single address in h…
=============
LMoulden
RT @vic777212718: A poorly educated population is much easier to control! Critical thinking skills not needed for the NWO! @realDonaldTrump…
=============
mom_for_peace
RT @VoteBlueNov3rd: @realDonaldTrump The day of your Arrest will forever be a National holiday.🇺🇸 
#MAGA  #TrumpVirus 
 100,000+
=============
molon_labe1911
RT @Brain1Rn: Now... all of a sudden paper ballots are just Fine... right Nadler? 
@realDonaldTrump 
@charliekirk11 
#VoteRedToSaveAmerica…
=============
Dittothat1
@Amynicole1005 @KateriaRyri @HKrassenstein @realDonaldTrump No it doesn’t matter when her significant other doesn’t… https://t.co/9jgMHaaxbD
=============
LemeritusPrime
@realDonaldTrump 1-30 "We have it under control."
2-10 “By April, it miraculously goes away.”
3-4 “It’s very mild.”… https://t.co/U5RohCd48v
=============
cdech34
@realDonaldTrump How ‘bout this? Let’s ask every voter to take an image by snapping a picture, copying or scanning… https://t.co/1vVcWgmKuu
=============
dfrntdrmmr
RT @HowardA_Esq: Dear @realDonaldTrump: you racist, raving, simpleminded, syphilitic lunatic:

It's not "China virus." It's SARS-CoV 2, whi…
=============
KaraMar111
RT @MAJMO50: Sorry to inform the Fortune 500 Lobbyists 👉 We don’t give a shit what you think or what you have to say! Today’s destructive L…
=============
slengypsum
RT @BrianKarem: From a D.C. area doctor: "If they're lifting the lockdown it doesn't mean the pandemic is over - it means they have room fo…
=============
dave_judgment
RT @BrianKarem: From a D.C. area doctor: "If they're lifting the lockdown it doesn't mean the pandemic is over - it means they have room fo…
=============
Bob_Kehoe
@kenolin1 @senatemajldr @SenateGOP @realDonaldTrump No, no they don't. They sold that out a while ago in defense of… https://t.co/aYgHSD6dPN
=============
MichaelPaolucc8
@speakfreely2015 @realDonaldTrump This virus has killed 100,000 people in 3 months, multiply that x 4 = 400,000 peo… https://t.co/KKIy4dTgUX
=============
Louper_
RT @LouiseMensch: That’s gross, @Jack. 
@JoeNBC should sue @RealDonaldTrump for defamation and the widower should sue him for intentional e…
=============
BarnMom52
@realDonaldTrump Please look into to Charlie Baker! He is NOT opening Massachusetts!!!!!!!
=============
FloridaAnonz
RT @GoJackFlynn: Deepest thanks to everyone. Let’s see what this week brings to all of us regarding the #Obamagate targeting of @realDonald…
=============
SaysTwat
@queensnycfrank @dailyblessings @TalbertSwan @SexCounseling @WyattCatarina @realDonaldTrump Matthew 23 https://t.co/bR8BoWtbZQ
=============
NormanJ5
@justus_joey @adamcawa @TrumperForYang @AndrewYang @realDonaldTrump Well, It does support my point that re-naming a… https://t.co/lCQmUVmE7S
=============
Foxrealfakenews
@realDonaldTrump There is no cold case. It was ruled a death by natural cause.  She had a heart attack
=============
jGibson_Hanes
RT @iTzJSwag: @MarkMil31980836 @NK75078676 @Jacksup31 @BeeDan2020 @CheriJacobus @realDonaldTrump He didn’t have to go there... he raped a 1…
=============
BuzzlabCana
@realDonaldTrump ☝️☝️☝️
=============
EvieWeed
@godmoringmm @SexCounseling @realDonaldTrump People who crowd beaches and parks are the reason we aren’t opening qu… https://t.co/kORw1DSw8n
=============
CherylBouchard9
RT @saribethrose: Thank you @karaswisher for writing this. Please @jack delete these false, cruel &amp; shameful tweets from @realDonaldTrump &amp;…
=============
SunnySFC60
RT @CaslerNoel: If I could distill all my knowledge of Trump into one insight, it is this: he felt so entitled that he thought he could get…
=============
santarj18
@realDonaldTrump You knew about this in early January maybe sooner quit the blame game and fucking do your job you narcissist piece of shit
=============
jlheaden
@realDonaldTrump Afraid of jail! You said if we had mail in voting not another republican would be elected! And you… https://t.co/KMfVCPmf1x
=============
LoisEiler
@realDonaldTrump Sorry you did NOTHING but downplay it in Feb and March.  YOU preferred to golf and hold rallies.  We are DONE with you.
=============
djohnson4826
@brithume @realDonaldTrump FUCK YOU!!! YOU AIN'T SAYING NOTHING ABOUT GEORGE FLOYD YOU BUM ASS WHORE!!
=============
kendulin
@RepDougCollins @JoeFreedomLove @realDonaldTrump Dear @realDonaldTrump Please I beg you do not trust any… https://t.co/YMr4jJ3jUh
=============
rebeloyalty
RT @jwgop: In any business, @realDonaldTrump would be fired and escorted to the curb. In any family, he would be entered into a facility to…
=============
travelgirlann2
@ronboy98 @RepDougCollins @realDonaldTrump I'm not sure what you are referencing with your "putting yourself first"… https://t.co/z7s16J1oMX
=============
AltimusHastings
If Twitter shut down @realDonaldTrump’s account, every conservative would follow him to his chosen outlet. Then Twi… https://t.co/IUygD1Mtfb
=============
GarrettClif
@realDonaldTrump @GarrettClif
=============
Gilas79201942
Poliziotti con manganello contro ragazzi adolescenti!!!
=============
TomSullBoston
@wolfblitzer @realDonaldTrump https://t.co/VXS7xD994N
=============
babalou137
@JoAnnViera1 @newtgingrich @realDonaldTrump @gracemarietweet Wear a mask and try to go in with no shirt or shoes.
=============
AdonicaSS
@Rich3Dawg @realDonaldTrump Absolute truth.
=============
Battleriverbab1
RT @WelchCorgiLover: @MiaFarrow @realDonaldTrump To say nothing of how trump has denigrated the press, in my opinion his worst crime
=============
idgeorgio
RT @SexCounseling: @realDonaldTrump They don't complain about the deaths that happen in the inner cities everyday or that suicide has gone…
=============
markrey58083564
RT @mattgaetz: Black Florida School Superintendent goes off on @JoeBiden 

Strong supporter of @realDonaldTrump! 

🔥🔥🔥🔥🔥 https://t.co/quh78…
=============
IanOxford2
@PapaPorter1 @QuantumChic5D @C487162158 @realDonaldTrump @MELANIATRUMP What lack of respect you have for women
=============
bostonbev71
RT @JoVotes45: After 33 years in Congress, trillions of dollars, and too many lives lost @SpeakerPelosi still doesn’t have a plan to end Il…
=============
voss_cj
RT @WasARepublican2: @realDonaldTrump Good thing only 30% of the Country are dumb enough to fall for your desperation. The rest of us know,…
=============
LoisRobbins8
RT @BrianKarem: From a D.C. area doctor: "If they're lifting the lockdown it doesn't mean the pandemic is over - it means they have room fo…
=============
SammyAce17
RT @MiaFarrow: @realDonaldTrump You waited 2 months to act. Iceland had same info but began testing &amp; tracing on Jan 31- a month before the…
=============
realeftypickit
RT @RKJ65: More Americans have now died from COVID-19 than from the Vietnam War, the Koren War and the 9/11 terrorist attacks combined. 

I…
=============
subra_2k123
@realDonaldTrump Let's get the folks straight
"I AM A TRUMPIAN"
are you. Please retweet worldwide to get all suppor… https://t.co/ZMUpJu0IcZ
=============
KarenKyia
RT @GOP: “In America, we need more prayer, not less.” -@realDonaldTrump
=============
jons115
@realDonaldTrump The governors made themselves look good, you punted responsibility to them.
=============
tammylangford9
@kushbreath416 @gtconway3d @realDonaldTrump It is horrifying
=============
micheleb801
RT @Jnb928: Will @realDonaldTrump end up in prison? Charges he faces once out of office … obstruction of justice, illegally withholding mil…
=============
DavidFDodge1
@cuxto @TC_Woods @PDemo71 @realmayalani @SpeakerPelosi @realDonaldTrump #Trump tweets more than an angry Big Bird.… https://t.co/TuQujRpkZZ
=============
RHINEVALLEYKEN
RT @SayWhatUThinkCA: Not only a coward, a coward who admires basic dictatorships. https://t.co/G1r1y0Z29T
=============
JanHigh5
@realDonaldTrump @lgutwein99_31 You need Peggy Hubbard.. https://t.co/UZpt9JDl2E
=============
Austinsuccess13
RT @OkeZion1: On the 30th of may  Biafrans world wide will remember this Tyrant yakubu gowon that supervised d Biafran Genocide/holocaust t…
=============
jilevin
What is the biggest difference between @BarackObama and @realDonaldTrump? https://t.co/hLy4iPQZzK
=============
RayElliott62
@realDonaldTrump You have a lot of nerve talking about any other presidents’ or vice-presidents’ handling of pandem… https://t.co/12WTaFnwm6
=============
ramesk468
RT @TaxReformExpert: If your state is still closed and the economy is in shambles, don’t blame President @realDonaldTrump.

Blame your Gove…
=============
LiliMoM
RT @cuban_manny: @realDonaldTrump I remember growing up in elementary school &amp; playing a game in the bathroom throwing toilet paper in the…
=============
Chevyr6
@realDonaldTrump So when you said it would go away on its own and was just the flu.  Was that doing your job well?
=============
ljcambria
RT @TammyParry: @realDonaldTrump See thread 🧵 for second part.....
#Qminus https://t.co/18wtdOeJLY
=============
djsilverback13
@realDonaldTrump https://t.co/aVe8htp4b8
=============
MikeMirabella3
And once she got to know the real Trump she began to change her mind. The same was true of me. I originally support… https://t.co/XGIjtP2ygA
=============
CarolCiaccia
RT @RepDougCollins: By deeming churches essential, @realDonaldTrump is standing for our Constitutional rights.
 
We need to open our church…
=============
GarthJocelyn
RT @CaslerNoel: Remember that time when Ambassador Yovanovich got in the way of Joe Scarborough’s plans to shakedown Ukraine and he turned…
=============
bbrown5894
RT @GinGinnele11: Will it be impossible for @realDonaldTrump  to rebuild the economy?
=============
CherMillerNOLA
Boom!
=============
davidmd1971
RT @TomFitton: MORE FRAUD IN OREGON: Non-Citizen Steps Forward, Tells How Oregon Automatically Registered Her To Vote Via Motor Voter Bill…
=============
CurtisJhan
What is 25th For if not ALL THIS. WE HAVE 0 LEADER. HE SHOULD FLATLEY BE IGNORED NOT ABLE TO VETO WAR BILL! MY GOD.… https://t.co/nlJdjMbF7B
=============
StitiousLittle
@docelm0 @posotus @KashJackson2018 @IlhanMN @realDonaldTrump Sorry, that was a cheap shot. I regretted after typing that tweet.
=============
Goose8812
@realDonaldTrump Shut you cock holster and go away https://t.co/TG7AeBhj2j
=============
Batayear
@itsJeffTiedrich @realDonaldTrump Eat sh:t
=============
Simwins1
RT @pantomath__: @realDonaldTrump https://t.co/ia2Gdd6zke
=============
stevenmethier
@pill1519 @KamalaHarris @realDonaldTrump @JoeBiden @amyklobuchar @TulsiPress Oh you mean not be afraid of the globa… https://t.co/FDNzA02R9H
=============
WotansBeard
@senatemajldr @realDonaldTrump @POTUS @VP @seanhannity @Mike_Pence @FLOTUS @GOP @WhiteHouse @PressSec… https://t.co/v7XP0RXJTd
=============
BobDurland
RT @inthecopa: Marlarkey Joe using Americanism fortitude to hide what he truly means: Hope &amp; Change. Remember that bs?

Joe on Obama social…
=============
mooncult
@den_down_unda @TonyBeast1957 @RicoSuaveJD @itsJeffTiedrich @realDonaldTrump breeth*
=============
Chris_Ortiz808
@itsJeffTiedrich @realDonaldTrump He’s asking for a diaper change.
=============
ArthurA58946961
RT @JosephJFlynn1: There is only one side to this.. the FBI leadership under @Comey spied illegally on @GenFlynn  and illegally set a perju…
=============
familyliss
RT @AnthemRespect: Nothing could possibly go wrong here???

.@realDonaldTrump is right

Man finds 83 ballots shipped to single address in h…
=============
karenjo14026204
RT @itsJeffTiedrich: @realDonaldTrump grow up, you're embarrassing the entire country
=============
DCowboysFan20
RT @Alyssafarah: This is simply false. @realDonaldTrump was literally announcing the @CDCgov's guidelines for safely reopening houses of wo…
=============
HofmannGl
RT @lesleyabravanel: Dear @omidkordestani, @RealDonaldTrump's @Twitter account incites hate-fueled violence.  Please remove it. Thanks.
#Ta…
=============
RSSinAction
@realDonaldTrump TRUMP ADMINISTRATION IS WILLING TO PAY FOR U.S. COMPANIES TO UPROOT THEIR SUPPLY CHAINS AND BRING… https://t.co/eKzgtnLSk2
=============
AnnFrannie
RT @CaslerNoel: Guess all those secrets you made us sign NDA’s for on ‘Apprentice’ are getting out Donnie. My bad. @realDonaldTrump
=============
kris_keyes01
RT @AmoneyResists: @realDonaldTrump You didn’t do your job well or early. No one predicted millions would die. Your “ban” went in place AFT…
=============
GordonSm3
@RepDougCollins @realDonaldTrump https://t.co/UEVC4FrGFD
=============
PatrikyaK
@realDonaldTrump YOU ARE GOING TO PRISON,  #TrumpCovidKiller. 
Have one of your minions explain NEGLIGENT HOMICIDE… https://t.co/WArDk0Sa7M
=============
sphillips2000
RT @BrianKarem: From a D.C. area doctor: "If they're lifting the lockdown it doesn't mean the pandemic is over - it means they have room fo…
=============
PJrtx
RT @8_okie: If you had told me 10 years ago that a billionaire tycoon from NYC would capture my loyalty, would be the savior of my country,…
=============
Zanderland3
RT @RoydYure: @realDonaldTrump https://t.co/y1a45Eo69n
=============
HnBluvrs
@JoJoFromJerz @realDonaldTrump I believe in your freedom of speech, but do better research befor peddling ignorant propaganda
=============
OnConsideration
RT @CaslerNoel: If I could distill all my knowledge of Trump into one insight, it is this: he felt so entitled that he thought he could get…
=============
SthrnMomNGram
RT @RealVinnieJames: @MoscowMitchCCCP @realDonaldTrump That's from THEIR own numbers. It's easily researched online. Here's one of their OW…
=============
12841chelmno
@Fortunateone9 @MarinelliSauce @SexCounseling @realDonaldTrump How is stating something proof of anything?
=============
barista_diva
@DocNifkin @seanhannity @BernieSanders @realDonaldTrump That was #Chinas fault.  Not arguing, you are just going to keep biting.
=============
OklasotaGal
RT @HKrassenstein: @realDonaldTrump It's time to #TakeTrumpOffTwitter for constantly breaking their rules.  He's using his pedestal to crea…
=============
abgweth
RT @fighterbsp: @realDonaldTrump Cops treatment of Black Suspect and White Offender isn’t same 🙄

These two images says it all ...🤷‍♀️ 

#i…
=============
LCossio_1
@realDonaldTrump We will vote you OUT in November!   And transition to the amazing @JoeBiden #VoteBlueToSaveAmerica #TakeTrumpOffTwitter
=============
Fredrick1969
@realDonaldTrump I absolutely agree that next year will be the best ever only because you will be in jail by then.… https://t.co/dNZG5xnAnL
=============
manazelrod
RT @VictoriaLevine5: @mwwilliams @pantomath__ @realDonaldTrump And yet you support the 3X married, 3X adulterer, who banged a porn star wit…
=============
terrigirl2
RT @DexterBoiGenius: @briantylercohen @realDonaldTrump What a disgrace https://t.co/8fh9uEwTZS
=============
Navy_Lady_45
'Deeply sorry': Twitter apologizes for Trump's conspiracy theory on Scarborough intern death.

So, T.w.i.H.i.t.l.e.… https://t.co/DOvcxoiTTj
=============
sandrakraft15
@onlytruthhere @realDonaldTrump The red hats trigger you and your type so much ❤️🤡
=============
groepraz
@realDonaldTrump So you would prefer voting machines being hacked by your Russian friends, I guess. Votes on paper… https://t.co/L3ADrY9i8K
=============
garr458
RT @LegionBobo: Considering ALL the controversies @realDonaldTrump started because of his tweets; how different would the world be if he ha…
=============
Robino2020
RT @QTek8: https://t.co/DzfvQstqJk https://t.co/xdV0VD25By
=============
CES_BlueWave
RT @Doug2r66: @letswinin2020 @pantomath__ @realDonaldTrump https://t.co/QH3UlCJC6B
=============
rosychevalier
RT @ScottPresler: @realDonaldTrump Thank you, President Trump.
=============
thehajdik1
RT @TX_WalkerRanger: I’m not a bot, I’m a @realDonaldTrump supporter. These platforms gather our data when we’re not using their app, but t…
=============
GregRochford
@realDonaldTrump @SeanParnellUSA Sean, a shout out from Dinky Dick Orange Donny, and then you talking about someone… https://t.co/oimT5FCFcc
=============
iamchristian26
RT @MeidasTouch: @realDonaldTrump You said it was a hoax. Then you said we were in a war, but devised no plan. Then you threw in the towel.…
=============
KarmaSQuirr3l
RT @Adrienne711: Thread by @love4thegameAK: https://t.co/CrvqJpbyGs… President @realDonaldTrump speaks at Fort McHenry in Baltimore: "They…
=============
michaelkhiabani
RT @mattgaetz: Black Florida School Superintendent goes off on @JoeBiden 

Strong supporter of @realDonaldTrump! 

🔥🔥🔥🔥🔥
=============
oldtimer1968
Born on the Manor 

THE Game of Thrones

WAS NOT JUST A MOVIE IT WAS A WARNING!

NOW IN THE AGE OF CLONE WARS SO WA… https://t.co/B3ODf93G2t
=============
todorov_denis
RT @ItalyQanons: 🔥SIAMO PAZZI ?????

RETWITTATE AL MASSIMO che domani toccherà a noi !!!

@matteosalvinimi @LegaSalvini @GiorgiaMeloni @FLO…
=============
_innerPanda
@DlaineStudios @PSketchie @jeremynewberger @realDonaldTrump You seem to be the one making vast overgeneralizations. Reflect on that.
=============
vic777212718
Planned Parenthood affiliates illegally lined their pockets with taxpayer funded SBA loans designated for small bus… https://t.co/mybbwAzfN3
=============
throwmout8888
RT @itsJeffTiedrich: @realDonaldTrump @lgutwein99_31 I guess this isn't one of the thousands of farmers you bankrupted because of your ruin…
=============
CommaMisplaced
@realDonaldTrump Killing Americans by not managing a pandemic properly. Is that an up or a down for you?
=============
hisbruja16
@pantomath__ @realDonaldTrump https://t.co/Y3zRXgOUfV
=============
LoRenzoShabazz
RT @real_defender: @realDonaldTrump Joe Biden must have forgotten about the thousands of times Obama played golf as president. He played go…
=============
troderick07
RT @ScottPresler: @realDonaldTrump 13 🔵🔜🔴 seats:

CA07: @BuzzPatterson
CA10: @Ted_Howze
CA21: @dgvaladao
CA39: @YoungKimCA
CA45: @GregRaths…
=============
1MyUniverse
RT @tedlieu: Today is Tuesday. That means @realDonaldTrump is lying, again. Dems were writing pandemic legislation in February while @POTUS…
=============
TanushOjha
@DlaineStudios @jeremynewberger @realDonaldTrump You’re*
=============
jossietico
RT @RealJaneGalt: @BoSnerdley Patriots, say a quick prayer for Rush Limbaugh right now. When you have, retweet this message. Rush believes…
=============
LindaMa84889149
RETWEET THIS VIDEO OVER AND OVER. Trump is lying about many things, and ruining the very democracy that freed us.… https://t.co/mVVjidWxWR
=============
MyBigRedTruck
@853_732 @jack @realDonaldTrump Now I ask you, would you take time to see what is going on in Twitter if Trump was… https://t.co/eNx7vSZlqD
=============
MarcJon02606516
@itsJeffTiedrich @realDonaldTrump Hey jeff! Biden is gonna absolutely destroy trump in the debates isnt he. 😁
=============
JKrisHudson
RT @kenolin1: Dear @senatemajldr &amp; @SenateGOP,
Have you any decency left? We know @realDonaldTrump doesn’t trade in civility and propriety.…
=============
tami_b1
@Desiree76636838 @GinGinnele11 @realDonaldTrump Same!
=============
jani1881
@realDonaldTrump https://t.co/Qsn9rbsoAd
=============
TaggartRearden
RT @NeeseForOK5: Have you made a plan to vote in the Oklahoma Republican primary on Tuesday, June 30th? President @realDonaldTrump &amp; I are…
=============
betsorj
@realDonaldTrump Worried much?  

#VoteByMail2020 
#TrumpHasNoPlan 
#TrumpLiedAmericansDied 
#VoteBlueToEndThisNightmare
=============
countryzoner
RT @olgaNYC1211: Why @jack is @realDonaldTrump allowed to tweet pictures of a Biden coffin, accuse a media personality of murder, and sprea…
=============
truckershdetree
RT @michaelbeatty3: 🇰🇷SOUTH KOREA🇰🇷
♥️LOVES JOE BIDEN♥️
a look back to 2012
@realDonaldTrump 
#Michigan @Scavino45
=============
srobhartkopf
@SexyAssPatriot2 @realDonaldTrump I'm so old I can remember when judges protected our civil rights from abuse by the State.
=============
Farmgirl286
RT @ToddWal47945939: @realDonaldTrump @VincentCrypt46 @lgutwein99_31 POTUS tweeted, Scavino tweeted and VK retweeted a post from @lgutwein9…
=============
CrestMonkey
RT @RealJaneGalt: @BoSnerdley Patriots, say a quick prayer for Rush Limbaugh right now. When you have, retweet this message. Rush believes…
=============
yug_guy123
@MD18013 @itsJeffTiedrich @realDonaldTrump Say that to Pelosi and to the people of CA.
=============
janabanana2015
RT @GeoScarborough: @realDonaldTrump a plea from the widower of the young lady who tragically died in @JoeNBC office 20 years ago for you t…
=============
sandranursing
RT @Counselor701: Only one mail fraud reported in the most recent past, and he was Republican: @realDonaldTrump @GOP https://t.co/KGZr0LkacP
=============
seattleprince
@realDonaldTrump https://t.co/zYrpnqsKc4
=============
redz8121
@realDonaldTrump I can’t get tested in NJ. Stop lying! #TakeTrumpOffTwitter
=============
AvaMoor34816208
RT @SassyChick1979: To @realDonaldTrump you are the lowest life form! My gawd saying things about a man’s dead wife! The things I want to s…
=============
daze420247365
@JohnQPu13727420 @gaeleigh @DoviSternNYC @itsJeffTiedrich @realDonaldTrump 😂😂😂
=============
teb_art
RT @CaslerNoel: Trump punched his music teacher in the face and threw rocks at a baby all while still a kid. When he became too much for hi…
=============
uncle_sam1776
RT @OMARRSHABAZZ: Here’s what the 2020 Presidential Election final results will look like between! @realDonaldTrump &amp; @JoeBiden 

I predict…
=============
laurie48094
RT @RepAndyBiggsAZ: California didn't set # or % for capacity requirements for reopening of dine-in restaurants, but set guidelines for chu…
=============
TheWidowStover
RT @David_Leavitt: @realDonaldTrump You’re the worst president ever and you’re going to rot in hell for eternity #TakeTrumpOffTwitter
=============
ednycinc44
RT @the_resistor: @realDonaldTrump How I Spent Memorial Day Weekend.  @JoeBiden &amp; @realDonaldTrump https://t.co/GxpeEpjw0k
=============
BarReNaples
RT @RoydYure: @soloyochapin @realDonaldTrump @WhiteHouse https://t.co/cJYYEUY1uR
=============
GreenEyedEmma2
RT @TomFitton: Biden shouldn't get a "get out jail free" card because he is running for office.
=============
Pintowin06
@realDonaldTrump I would give Cuomo some political cover. As death tolls continue to rise across America. Be united in the fight Helps u too
=============
Timinator_5000
RT @soloyochapin: @ChidiNwatu @realDonaldTrump @jack Hey @jack you should have suspended @realDonaldTrump account a long while ago

#TrumpO…
=============
TomMart42154683
@realDonaldTrump gee donnie you really should have added how much better you did than the H1N1 pandemic - there hav… https://t.co/BrkPQfUCnI
=============
FrankDiGir
@JohnHol20885637 @JeffreyGuterman @realDonaldTrump @GOP Boy..you just proved mine. You don't want safe and secure e… https://t.co/xrl2mxByR2
=============
SellRandall
@dj1028_jean @JodiLynnWalker @Hiiamhanson @tonyposnanski @realDonaldTrump Okay, lol
=============
MrGsAccount
@realDonaldTrump Dude! 100,000 dead is nothing for you to brag about! #TrumpPandemicFailure
=============
EricCampbell67
RT @SteveForbesCEO: .@realDonaldTrump and @SecAzar initiate bold plan capping seniors’ cost for insulin at $35 per month using manufacturer…
=============
jgantz33
RT @TaxReformExpert: If your state is still closed and the economy is in shambles, don’t blame President @realDonaldTrump.

Blame your Gove…
=============
skg617
RT @azmoderate: .@Policy even though you apologized for the @realdonaldtrump tweets that provides complete inflammatory &amp; proven false alle…
=============
SenMaxLobell
@ScottFeinberg @jack @JoeNBC @realDonaldTrump “I'm going to open up our libel laws so when they write purposely neg… https://t.co/qS7p6i5t8u
=============
Cynthia86957608
RT @CaslerNoel: Remember that time when Ambassador Yovanovich got in the way of Joe Scarborough’s plans to shakedown Ukraine and he turned…
=============
sjohnny847
@realDonaldTrump 100k number is wrong because they classified people that presumably had covid19 in with verified c… https://t.co/CL2Bfynh9P
=============
TrumpMomma
@sethjlevy Time to #FireWray and put #Grenell as FBI DIRECTOR

@Scavino45 @RichardGrenell @POTUS @TeamTrump @realDonaldTrump
=============
Tahsin70565308
@realDonaldTrump Hi friend
=============
DreamSpeaker
RT @BrianKarem: From a D.C. area doctor: "If they're lifting the lockdown it doesn't mean the pandemic is over - it means they have room fo…
=============
plcerny
@realDonaldTrump How...i dont remember being told to stay home for 3 months
=============
bgran03
RT @JayMaga45: I ask myself. How does this man put up with the evil people trying to take him down daily❓
 
Simple. @realDonaldTrump was ch…
=============
PonderThus
This tweet sure has aged well, eh @realDonaldTrump ?
#COVID
=============
OGivens
@realDonaldTrump @WhiteHouse This is about the 1.6 million infected, the 40 million unemployed and especially the 1… https://t.co/WgBLzKArBH
=============
StevenFlood8
RT @RepDougCollins: By deeming churches essential, @realDonaldTrump is standing for our Constitutional rights.
 
We need to open our church…
=============
ekollen1
RT @travisakers: I owe @realDonaldTrump a huge public apology. He was was right - There was election fraud in Michigan!

https://t.co/SmWoi…
=============
naynayfig
RT @intheMatrixxx: WWG1WGA https://t.co/61MFMU3Jcc https://t.co/Ljru12wogp
=============
JohnHol20885637
@FrankDiGir @JeffreyGuterman @realDonaldTrump @GOP The Gov't has to provide "due process" in order to take away you… https://t.co/FJGc4yA84y
=============
Q_Ashbrit
Fauci may be one of the largest frauds we’ve ever seen. I’m a Trump supporter, but I’ve got some questions as to wh… https://t.co/nzdcOPnu8Z
=============
Dee37940550
RT @KAFosterSowell: @Dunroamin4ever @TheHors84946608 @Nick_Clamorgan @realDonaldTrump That without a doubt was the saddest thing ever. #Gov…
=============
BDesigns6
RT @sxdoc: “I’m Black and I ain’t voting for no Biden Democrat”

Always told to vote for someone smarter than I am. That’s NOT any Democrat…
=============
DontTreadOnUS
RT @JGilliam_SEAL: NYC 1000’s of ICU beds were set up at @javitscenter, Navy Ship Comfort &amp; mobile care facility (cost $150 million) on Lon…
=============
StuBeale
RT @TaxReformExpert: Government red tape is about to be cut!

Last week, President @realDonaldTrump signed an executive order making hundre…
=============
whec65
@Minuteman04 @realDonaldTrump He wants all of the votes, not just some of them. Plus, Putin can then track those wh… https://t.co/c5b6FYR4yc
=============
Rfranz19
RT @tedlieu: Today is Tuesday. That means @realDonaldTrump is lying, again. Dems were writing pandemic legislation in February while @POTUS…
=============
Nephandus
RT @mattgaetz: Black Florida School Superintendent goes off on @JoeBiden 

Strong supporter of @realDonaldTrump! 

🔥🔥🔥🔥🔥 https://t.co/quh78…
=============
Lindachampa1
@swadylady @CaslerNoel @realDonaldTrump His lawyers always ask for delays, and usually get them.  Summer and E. Jea… https://t.co/cs0omnBCnY
=============
desertdettra
RT @TrumpWarRoom: @realDonaldTrump A comprehensive report on Joe Biden's handling of H1N1 concluded that it “was not the panacea portrayed…
=============
jojake111
RT @TrumpNewsPolls: @realDonaldTrump https://t.co/RP4jzeR2Ws
=============
MaziOjemba
RT @ChinasaNworu: The awareness for the restoration of #Biafra continue to gather momentum #Alexa audio is helping to spreading the message…
=============
clownpuncher22
RT @RealBasedMAGA: If you’ve ever doubted liberals are fascists, just look at the comments in #TakeTrumpOffTwitter 

The most vile ppl who…
=============
1redneckfish
RT @TheReal_NRP: Here’s @realDonaldTrump in The Preschool Apprentice Episode “Big comfy chair” #comedy #DonaldJTrump #impressions #sketch @…
=============
Kurt98417141
@brithume @realDonaldTrump Smart man Biden is! The president almost certainly is in a high risk group for Covid 19.… https://t.co/QeNWtUlYs6
=============
jeisenhart74
@realDonaldTrump Rather than constantly trying to lie away the truth, why don't you simply acknowledge the people w… https://t.co/4mgYjpX2jX
=============
makinmyfuture1
@realDonaldTrump shame on you
=============
MTU85BSEE
@realDonaldTrump https://t.co/FjD8elgtTK
=============
BobDurland
RT @no_silenced: @realDonaldTrump JUST IN: Trudeau announces contract with GM to make 10 million masks to battle COVID-19

This is what hap…
=============
badeaux_mark
@susan_erikson @Amy_Siskind @brithume @realDonaldTrump Clarify please... I'm drawing a distinction between saying t… https://t.co/U8D8VqhG1m
=============
zaklalonde
RT @MeidasTouch: .@realDonaldTrump spent his weekend rage-tweeting three brothers who got under his skin after we pointed out his blatant h…
=============
System_is_broke
RT @TheRickWilson: Poor @parscale.
=============
galea_don
@realDonaldTrump 100,000 Dead Americans and climbing. 
Your on a roll!!
=============
wachonico
@realDonaldTrump You're right..

https://t.co/whgBHXqjlW
=============
kldreams61
RT @RichforGA: .@GovKemp made a bold move to open back up, data shows we are doing it safely.  It would be an honor to host @realdonaldtrum…
=============
BourdinFred
LBJ and CIA had a hand in taking out JFK records still sealed 😎🇺🇸 https://t.co/vkmpJdLJuO
=============
sjpgirl
RT @jisenberg76: @Xtinaresists @KansasSnotCom @AnnCoulter This has been going on long before @realDonaldTrump. Stop blaming him for everyth…
=============
TimeToSayGood15
@realDonaldTrump @lgutwein99_31 "If Trump had begun imposing social distancing measures one week earlier than he di… https://t.co/9dtjDubo6R
=============
DianeBo11037718
@LindseyGrahamSC @realDonaldTrump You mean doing a duty that all presidents are expected to do?? When are you going… https://t.co/sqGQUXFM9j
=============
thecubster1
@realDonaldTrump https://t.co/TajPcvlBpC
=============
linda94861521
He’s a user. Anything and anyone in his life is only for how they are useful for him at the moment.
=============
toms_mrs
@realDonaldTrump @lgutwein99_31 BEAUTIFUL

#Trump2020NowMoreThanEver
=============
oftheopposition
RT @CaslerNoel: Remember that time when Ambassador Yovanovich got in the way of Joe Scarborough’s plans to shakedown Ukraine and he turned…
=============
Raybuck1Sierra
@RickGoldFDN @pantomath__ @realDonaldTrump I never watched FOX before not after, but yeah they lie and propagate ne… https://t.co/Ul5rgh0j4E
=============
royce_lois
RT @real_defender: @realDonaldTrump Greatest president ever. Who is with me?!
=============
ani1luv
@realDonaldTrump You haven’t done your job well. You’ve done a shit job. You don’t know HOW to do the job. You just… https://t.co/RWkFZKqjwD
=============
A4Ny14
@girlsreallyrule #TrumpDeathToll100K+

#TakeTrumpOffTwitter 

 https://t.co/fxLXzFX6x5

And, while we're at it, #InvestigateIvanka!
=============
DeNovo1968
@realDonaldTrump Well, that's the important thing. 
35 million unemployed. trump virus kills 98,000 w/1.8 million i… https://t.co/mes9gQPcUH
=============
JoanLEsposito
@realDonaldTrump You're a moron.

@jack #TakeTrumpOffTwitter https://t.co/y8qMrkNMnw
=============
ceciliaannh
RT @BrianKarem: From a D.C. area doctor: "If they're lifting the lockdown it doesn't mean the pandemic is over - it means they have room fo…
=============
Michael54674588
RT @mmpadellan: @realDonaldTrump 100,000 dead Americans does NOT deserve "great reviews," Spanky.

It deserves HANDCUFFS.

This happened on…
=============
RubbedDry
RT @jonathanalter: Let's see--8 golf dates and 11 rallies in the period when ANY other president would have been replenishing stockpiles, r…
=============
bbk2228
@RobertBeaudry13 @HirshLiza @inKelso @GOPLeader @realDonaldTrump Groceries,heat,water,electric,gas, not counting repairs on everything
=============
SiriusRick23
RT @QPatriot17: KILL THE CENSORSHIP NOW

WORLDWIDE

@POTUS @WhiteHouse @DanScavino @Scavino45 

FREE THE PEOPLE INSIDE OF IRAN!!!!!!!!!!!!!…
=============
the1murdock
RT @105kacy: @RichforGA @the1murdock @GovKemp @realDonaldTrump If GA, I will surely plan to be there at some point. 😃 NC would be feasible…
=============
Battleriverbab1
RT @acnewsitics: @realDonaldTrump If we did lose 1 1/2 to 2 Million People Trump would still say if he hadn't done his job well we would ha…
=============
AnniesRocker
@realDonaldTrump @lgutwein99_31 FAKE. You expect us to believe that a farmer, at ground level, somehow steered a la… https://t.co/kW1rEzOLwr
=============
marisol27605634
@AlemaniaenArg @AliciaTerada_ @realDonaldTrump I lern the lesson Im with Nahuel in God and Jesus love.Can u stop?
=============
ApophasisWonder
@JenNicole1014 @mmeverett @CheriJacobus @realDonaldTrump What is it with lefties and weird sexual devices #pizzagate
=============
mussled
@realDonaldTrump Of course it wasn’t your original thought. You’ve never had an original thought in your head in your entire life.
=============
RajniPandeyBJP
RT @AyushGu11547368: Know R.S.S. @RSSorg @friendsofrss @shriniwas_hr @AmitShah @PMOIndia @narendramodi @DrRPNishank @sudhirchaudhary @realD…
=============
bodabasi
@SecPompeo @realDonaldTrump
Instead of lecturing other countries on Human rights, better your system. Recklessly Po… https://t.co/gTx6PS50Xg
=============
kay_roy1
RT @lm31356: @Amy_Siskind @realDonaldTrump https://t.co/0iQ2Sp7rqB
=============
DeermanNan
@DavidGo14591862 @Porter_Anderson @realDonaldTrump @maggieNYT @nytimes I hope this is right.
=============
BlueWaveBob
RT @CaslerNoel: Trump punched his music teacher in the face and threw rocks at a baby all while still a kid. When he became too much for hi…
=============
lala77_laura
RT @patriot_north: It has to be the Twitternazis! 
They seem to be ramping up their efforts to impede all patriotic traffic and spread as m…
=============



---------------------------------------------------------------------------

KeyboardInterrupt                         Traceback (most recent call last)

<ipython-input-113-28b0cf489d4d> in <module>()
     20 #3. Start listening
     21 #.  Here we use "track=" to provide a list of terms to listen for
---> 22 myStream.filter(track=["@realdonaldtrump","@myoung","@cocteau"])


/usr/local/lib/python3.6/dist-packages/tweepy/streaming.py in filter(self, follow, track, async, locations, stall_warnings, languages, encoding, filter_level)
    448         self.session.params = {'delimited': 'length'}
    449         self.host = 'stream.twitter.com'
--> 450         self._start(async)
    451 
    452     def sitestream(self, follow, stall_warnings=False,


/usr/local/lib/python3.6/dist-packages/tweepy/streaming.py in _start(self, async)
    362             self._thread.start()
    363         else:
--> 364             self._run()
    365 
    366     def on_closed(self, resp):


/usr/local/lib/python3.6/dist-packages/tweepy/streaming.py in _run(self)
    264                     self.snooze_time = self.snooze_time_step
    265                     self.listener.on_connect()
--> 266                     self._read_loop(resp)
    267             except (Timeout, ssl.SSLError) as exc:
    268                 # This is still necessary, as a SSLError can actually be


/usr/local/lib/python3.6/dist-packages/tweepy/streaming.py in _read_loop(self, resp)
    314             length = 0
    315             while not resp.raw.closed:
--> 316                 line = buf.read_line().strip()
    317                 if not line:
    318                     self.listener.keep_alive()  # keep-alive new lines are expected


/usr/local/lib/python3.6/dist-packages/tweepy/streaming.py in read_line(self, sep)
    179             else:
    180                 start = len(self._buffer)
--> 181             self._buffer += self._stream.read(self._chunk_size)
    182         return six.b('')
    183 


/usr/local/lib/python3.6/dist-packages/urllib3/response.py in read(self, amt, decode_content, cache_content)
    442             else:
    443                 cache_content = False
--> 444                 data = self._fp.read(amt)
    445                 if amt != 0 and not data:  # Platform-specific: Buggy versions of Python.
    446                     # Close the connection when no data is returned


/usr/lib/python3.6/http/client.py in read(self, amt)
    457             # Amount is given, implement using readinto
    458             b = bytearray(amt)
--> 459             n = self.readinto(b)
    460             return memoryview(b)[:n].tobytes()
    461         else:


/usr/lib/python3.6/http/client.py in readinto(self, b)
    491 
    492         if self.chunked:
--> 493             return self._readinto_chunked(b)
    494 
    495         if self.length is not None:


/usr/lib/python3.6/http/client.py in _readinto_chunked(self, b)
    586         try:
    587             while True:
--> 588                 chunk_left = self._get_chunk_left()
    589                 if chunk_left is None:
    590                     return total_bytes


/usr/lib/python3.6/http/client.py in _get_chunk_left(self)
    554                 self._safe_read(2)  # toss the CRLF at the end of the chunk
    555             try:
--> 556                 chunk_left = self._read_next_chunk_size()
    557             except ValueError:
    558                 raise IncompleteRead(b'')


/usr/lib/python3.6/http/client.py in _read_next_chunk_size(self)
    514     def _read_next_chunk_size(self):
    515         # Read the next chunk size from the file
--> 516         line = self.fp.readline(_MAXLINE + 1)
    517         if len(line) > _MAXLINE:
    518             raise LineTooLong("chunk size")


/usr/lib/python3.6/socket.py in readinto(self, b)
    584         while True:
    585             try:
--> 586                 return self._sock.recv_into(b)
    587             except timeout:
    588                 self._timeout_occurred = True


/usr/lib/python3.6/ssl.py in recv_into(self, buffer, nbytes, flags)
   1010                   "non-zero flags not allowed in calls to recv_into() on %s" %
   1011                   self.__class__)
-> 1012             return self.read(nbytes, buffer)
   1013         else:
   1014             return socket.recv_into(self, buffer, nbytes, flags)


/usr/lib/python3.6/ssl.py in read(self, len, buffer)
    872             raise ValueError("Read on closed or unwrapped SSL socket.")
    873         try:
--> 874             return self._sslobj.read(len, buffer)
    875         except SSLError as x:
    876             if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:


/usr/lib/python3.6/ssl.py in read(self, len, buffer)
    629         """
    630         if buffer is not None:
--> 631             v = self._sslobj.read(len, buffer)
    632         else:
    633             v = self._sslobj.read(len)


KeyboardInterrupt: 

From here, we can create a bot that responds when someone mentions our screen name. We would simply replace @realdonaldtrump with our screen name. Or, we can return information requested, implementing a conversational interface to some data source or journalistic content. How many COVID19 tests have been conducted in the state of California?

With the Twitter API we also have the capacity to see how conversations move across Twitter. We can see who follows whom. We can see which accounts “amplify” others. Remember, Twitter is mainly concerned about “authentic conversation” and so the use of bots to amplify a message is not allowed. That said, authentic conversation can be quite interesting to watch…

from IPython.display import VimeoVideo
VimeoVideo(54858819,width=800)

We can also try to see which accounts represent real people and which are automated (or semi-automated).

Bot, bot, bot, goose!

The good people at Indiana Univeristy have “learned” characteristics of bot behavior, producing a score for any account. The learning (which we will return to formally later in the term) involves contrasting data from known bot accounts and “real” accounts. Each Twitter account is reduced to a number of characteristics to make this comparison. The list below was taken from one of their academic papers.

<img src=https://github.com/computationaljournalism/columbia2019/raw/master/images/b1.jpg width=500 style=”border:1px solid black”>

<img src=https://github.com/computationaljournalism/columbia2019/raw/master/images/b8.jpg width=400 style=”border:1px solid black”>

In general, this is a hard learning problem. But the color scale might give you a rough indication of when the conversation taking place involves authentic or somehow immitation accounts. And we might want to know the difference because it will help us judge whether we are witnessing (or partaking in) a genuine exchange of opinions or are instead part of an amplification campaign of some kind. Propaganda.

Lesson #1 of data science — Never trust an algorithm you didn’t write, and even then be very cautious! We can use these scores in various ways, always checking to see if they make sense, of course. Here we look at Pete Buttigieg’s followers…

<img src=https://github.com/computationaljournalism/columbia2019/raw/master/images/tg1.jpg width=500 style=”border:1px solid black”>

… and the people he follows.

<img src=https://github.com/computationaljournalism/columbia2019/raw/master/images/tg2.jpg width=500 style=”border:1px solid black”>

There are generic tools like Graph Commons for use on Twitter data to see how is retweeting, replying to or commenting on tweets. First, we are going to have a look at conversations that mention COVID19. We will use a platform called Hoaxy, again from our friends in Indiana. It’s a platform not a programming approach which means you might outgrow it quickly, but you should have an idea about how to create similar graphics from scratch. Let’s have a look at a “network diagram” that maps out who is mentioning, retweeting, replying to whom.

Hoaxy produces a network diagram, where each point represents an account on Twitter. The connections represent two accounts “in communication” by retweeting, replying or mentioning one another (with the relationship being described as directional – I might mention you, but you might not ever mention me). The colors of the points depict a scale that is meant to describe the “bot like”ness of an account.

Bots as a source of reporting

My Computational Journalism class embarked on amplification bots - bots that retweet automatically, hopeing to gain visibility for people and topics. Let me close with a short description of “The Follower Factory.”