This script runs a "Twint Zero" API Twitter query and returns the results in CSV format. It uses the main.go
script from zedeus/nitter to perform the query.
Before using this script, please make sure you have the following software installed:
- Go 1.16 or higher
- Twint Zero
- Python 3.10 or higher
- pip install pandas
To install Twint Zero, follow these steps:
-
Clone the Twint Zero repository to your local machine:
git clone https://github.com/PG_Insights/Twint_API
-
Navigate to the cloned repository:
cd Twint_API
-
Initialize the Go module:
go mod init twint-zero
-
Tidy the Go module:
go mod tidy
Twint Zero was created by Francesco Poldi, with contributions from Simon Archer.
Simon Archer: JSON formatting and attachments parsing
- Clone this repository to your local machine
- Open your terminal and navigate to the directory where you cloned the repository
- Run the following command to install the Python dependencies:
pip install -r requirements.txt
- Run the script using the following command:
python twint_api.py [query]
-
Clone this repository to your local machine
-
Open your terminal and navigate to the directory where you cloned the repository
-
Run the following command to install the Python dependencies:
pip install -r requirements.txt
-
Run the script using the following command:
python main.py [query]
where
[query]
is a string representing your Twitter query as described in igorbrigadir/twitter-advanced-search.This will run a Twitter query based on the given query string and save the result in CSV format.
By default, the script uses the
birdsite.xanny.family
instance of nitter, but you can modify this by changing the-Instance
parameter in thereturn_query_results()
function inmain.py
.
The CSV file will be saved in the twint-responses
directory in the same directory as the script, and will be named with the date and time of the query and the query string used for the query.
If you would like to contribute to this project, please feel free to create a pull request or open an issue.
If you have any questions or issues with this script, please feel free to fork it and fix it yourself.
This project is licensed under the MIT License.
This project was created by Dale Ludwinski for Let MO Play.
Visit us on Twitter.