TweetScraper
A simple script to scrape a list of accounts or single account from Twitter into a neatly formatted Excel file.
Install / Use
/learn @Durhamster/TweetScraperREADME
TweetScraper
A script using the Twitter API to do the following:
- Scrape a single account
- Scrape a list of accounts
- Get the follower count for a list of accounts
- Check a list of handles to see if any are suspended, private, or incorrect.
- Scrape tweets based on a keyword search.
All tweets and follower counts are saved to a formatted excel (.xlsx) file. All URLs will be converted to strings if they exceed the limit in excel (65,530).
Please note that this only scrapes up to the 500 recent tweets (the end result may be less than this depending on the account or keyword you are scraping for). This can be changed in the script itself.
Installation
Use the package manager pip to install the required libraries.
pip install -r requirements.txt
or
Using pipenv:
pipenv install
Obtaining a Twitter Developer Key
If you do not have a Twitter handle you must first sign up for one.
- Apply for API access
- Create your application.
- Get your authentication details.
- In the folder containing this README file (the main folder for this project)
- Open the .env file and enter the client id and secret like the following and save the file.
consumer_key = "YourConsumerKeyHere"
consumer_secret = "YourSecretKeyHere"
access_key = "YourAccessKeyHere"
access_secret = "YourAccessSecretHere"
More detailed instructions on how to obtain an api key can be found here.
Scraping Lists of Twitter Handles
When scraping multiple handles, this script will pause periodically to prevent the user from exceeding the rate limit.
To change the list of handles to be scraped, open the handles.txt file under the Account Lists directory. Do NOT include the '@' sign. Make sure to list one handle per line.
For example:
Twitter
Jack
BBCNews
Apple
Windows
msexcel
Android
Reddit
Discord
github
Related Skills
bluebubbles
350.8kUse when you need to send or manage iMessages via BlueBubbles (recommended iMessage integration). Calls go through the generic message tool with channel="bluebubbles".
claude-opus-4-5-migration
110.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
bear-notes
350.8kCreate, search, and manage Bear notes via grizzly CLI.
model-usage
350.8kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
