Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.
/ TwitterApiSearch Public archive

This is a script that aims to search twitter premiumAPi, return a json file, clean then extract information from the json file.

License

Notifications You must be signed in to change notification settings

BukiOffor/TwitterApiSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter API

This repository contains explanatory codes on how to work with twitter premium and twitter Api v02. The scripts aims to search twitter APi, return a json file, extract information from the json file and store the information in a database. This repository focuses more on the premium Api because its more difficult to work with and has fewer resources around.


Script Structure

python3 app.py 'query' query.json 

This script takes 2 arguments, the query you want to search for and the name of the json file you want your search to be saved as. it returns tweets within the last 30 days and a max results of 100 tweets per request.

python3 index.py

This script searches all the json file in your directory, extracts information from them and stores in a database. Also returns a txt/json file of the information.

 python3 access.py file.json 'username'

This script takes 2 arguements, name of a json file and the information you want to extract from it. The file must have been cleaned by index.py

python3 db.py

when run, creates a database named extracts. Contains codes that inserts information to the database.

files.csv

Logs extracted json files. To repeat extracted filenames be sure to delete used names from files.csv.


DOCUMENTATIONS

Twitter Api Documentation

Tweepy Documentaion


NOTE

Be sure to export your API keys into your prefered terminal or edit the script and manually fill it in. If something goes wrong while running, the script should provide you information about possible failures. Feel free to edit the code to better your search.

About

This is a script that aims to search twitter premiumAPi, return a json file, clean then extract information from the json file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published