Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Other examples

Francesco Poldi edited this page Nov 24, 2019 · 3 revisions

Here some examples

1 - Return tweets sent by an user that contain links

CLI

twint -u username --links include

Script

import twint

c = twint.Config()
c.Username = "username"
c.Links = "include"

twint.run.Search(c)

2 - Return tweets sent by an user that used the web client

CLI

twint -u username --source "Twitter Web Client"

Script

import twint

c = twint.Config()
c.Username = "username"
c.Source = "Twitter Web Client"

twint.run.Search(c)

3 - Return tweets containing a specific keyword and that have at least 5 likes

CLI

twint -s keyword --min-likes 5

Script

import twint

c = twint.Config()
c.Search = "keyword"
c.Min_likes = 5

twint.run.Search(c)

4 - Return tweets containing a specific keyword, that have at least 5 likes and that are part of a given users list

CLI

twint -s keyword --min-likes 5 --members-list "ph055a/osint"

Script

import twint

c = twint.Config()
c.Search = "keyword"
c.Min_likes = 5
c.Members_list = "ph055a/osint"

twint.run.Search(c)

5 - Translate tweets (experimental)

In this example we get 100 tweets written in English and translate them in Italian

CLI

twint -u noneprivacy --csv --output none.csv --lang en --translate --translate-dest it --limit 100

Module

import twint

c = twint.Config()
c.Username = "noneprivacy"
c.Limit = 100
c.Store_csv = True
c.Output = "none.csv"
c.Lang = "en"
c.Translate = True
c.TranslateDest = "it"
twint.run.Search(c)