Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to Use Twint OSINT Tool on Google Cloud Console ?

  • Difficulty Level : Medium
  • Last Updated : 17 Jun, 2021

TWINT is an advanced Twitter scraping tool written in Python that allows for scraping Tweets from Twitter profiles without using Twitter’s API.

Twint utilizes Twitter’s search operators to let you scrape Tweets from specific users, scrape Tweets relating to certain topics, hashtags, and trends, or sort out sensitive information from tweets like e-mail and mobile phone numbers. It is very useful for gathering information.

Benefits:

 Benefits of using Twint vs Twitter API:

  • Twint can fetch almost all Tweets whereas Twitter API limits to the last 3200 Tweets only.
  • Twint has a Fast initial setup.
  • It can be used anonymously and without any Twitter sign-up or log-in.
  • No rate limitations.

Requirements: Python 3.6

How to use Twint on Google Could Console.

Step 1: Log into Google Cloud Console using any of your Google accounts and click on the icon shown below.



(This is actually launching Google Cloud Console and giving you access to a machine where you can use “Twint“)

Fig1: Google Cloud Console

Note: If you are not using Google cloud console, then you need few things installed before you start using “Twint”. Those things can be installed by using the following commands :

  • apt install git
  • apt install python3
  • apt install python3-pip

Step 2: When the above requirements are fulfilled, run the following commands on the console to get started: 

  • git clone –depth=1 https://github.com/twintproject/twint.git
  • cd twint
  • pip3 install . -r requirements.txt
  • pip3 install twint

Fig2: Setting up Twint.

Step 3: Now we are ready to use it, so let’s use the following command, to see what this tool offers.

twint  -h

Fig3: Arguments we can use with Twint.

Step 4: Now, let’s use this tool on a user, say networkchuck for his last 20 tweets.

twint -u networkchuck –limit 20

Fig4:Showing user’s last 20 tweets.

Note: Now  what this tool is doing is that,



  • It isn’t using api.
  • No Twitter login required.
  • It is simply scraping twitter and is very powerful.

Step 5: Now suppose you want to search for tweets in which a specific keyword was used, say “raspberry pi”, we will use -s to search for specific keyword tweets.

twint -u networkchuck -s “raspberry pi”

Fig5: Highlighted words show that only tweets with raspberry pi are shown.

Step 6: Now, suppose you want to save tweets in a file, say rightnow.json, for this command will be,

twint -u networkchuck -s “right now” -o rightnow.json–json

nano rightnow.json–json

Fig6: Tweets saved in rightnow.json file.

There are various things you can do with this tool to gather information, so some examples to help you understand the basics are given below:-

CommandDescription
twint -u username It scrapes all tweets from the user’s timeline.
twint -u username -s pineapple  It scrapes all the tweets from the user’s timeline containing pineapple.
twint -s pineapple  It collects every tweet containing pineapple from everyone’s tweet.
twint -u username –the year 2014  It collects the Tweets that were tweeted before 2014.
twint -u username –since 2015-12-20  It collects the Tweets that were tweeted from 2015-12-20.
twint -u username –followers It scrapes a Twitter user’s followers
twint -u username –following  It scrapes who a Twitter user follows.
twint -u username –favorites It collects all Tweets a user has favorited.
twint -u username -o file.txtIt scrapes Tweets and saves them to file.txt.
twint -u username -o file.csv –csv It scrapes Tweets and saves them as a CSV file.
twint -u username –email –phone  It shows Tweets that might have phone numbers or email addresses.
twint -s “Donald Trump” –verified  It displays the Tweets by verified users that Tweeted about Donald Trump.

To open-source intelligence researchers, Twitter is a giant rich database full of information anyone can use, and with a powerful tool like twint we discussed above, where one person can gather information about another just by scraping his/her tweets.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!