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

Storing objects in a DB

Francesco Poldi edited this page Aug 11, 2019 · 1 revision

CLI

twint -u username --database tweets.db twint -u username --database tweets.db --followers --user-full

Scripts

Tweets

import twint

c = twint.Config()
c.Username = "username"
c.Database = "tweets.db"

twint.run.Search(c)

Followers and their information

import twint

c = twint.Config()
c.Username = "username"
c.Database = "users.db"
c.User_full = True

twint.run.Followers(c)

Then searching for data in the database might not be that easy. Here a short example.

Let's say that we scraped the followers of a given user with ID, how do we extract their ID from the database?

sqlite> select follower_id from followers where id=123;

where 123 is the ID of our target.

How do we get the ID of a target given his/her handle? We can use .Lookup function or just run

sqlite> select id from users where username="handle";

where handle is the handle of our target (please note that this information needs to be stored before)