Giter VIP home page Giter VIP logo

trumptwitterdoppelgangerdetector's Introduction

Is your twitter friend actually Donald Trump in disguise?

After twitter banned @therealdonaldtrump, the American president went on to tweet from different twitter accounts related to the Trump campaign. Apparently, his media manager - Gary Coby (@garycoby) - offered President trump his own account. Twitter noticed and swiftly banned @garycoby as well.

I believe that the Trump campaign will have learnt from that event. So now, if ex-President Trump wishes to use someone else's account secretly, they won't announce it, so that they can post undettered.

So who's to say that your new friend isn't actually Donald Trump?

There's only 1 way to find out!

While he can change his profile details, we can assume that his tweets will remain somewhat similar! Humans are, after all, creatures of habit. So how can we figure out if your friend is secretly Donald Trump?

Simple!

We will see your friend's (or any public account's) recent tweets! And if they're similar to what DJT would have posted, I have some bad news for you :( We will be using the Levenshtein algorithm to compare your friends tweets to all of DJT's tweets over the past 6 months!

Simply run the program (assuming you have Twitter's API keys) python3 trumpdetection.py and enter your suspect's username :)

Twitter Authentication

In my code, I've imported a custom module called twitterauthentication.py. In that module, I have listed out the Twitter API keys. You will need to get your own API keys to use this. You can learn how to do that very easily here (Note that this page also shows how to connect to the API. However, the code in trumpdetection.py already accounts for that through the use of the tweepy module). Alternatively, you can explore the twitter api and the tweepy module in greater depth with this great instructional video

# The twitterauthentication.py file is written as below. 
# Listing the file under .gitignore ensures that you don't accidentally reveal your API keys if you push it online.

appAPIKey = "XXXXXXXXXXXXX"
appAPIKeySecret = "XXXXXXXXXXXXX"
appBearer = "XXXXXXXXXXXXX"
appAccess = "XXXXXXXXXXXXX"
appAccessSecret = "XXXXXXXXXXXXX"

trumptwitterdoppelgangerdetector's People

Contributors

rayarka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

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

  • D3 photo D3

    Data-Driven Documents codes.