Skip to main content

A simple Twitter scraper

Project description

Will Chen's Twitter Scraper

A simple command-line tool to fetch and process tweets.

Features

  • Fetch tweets from a specific user (most recent -- up to 3200)
  • Save tweets to JSON
  • Convert JSON tweets to a readable text format
  • Retrieve a specific tweet by ID
  • Retry on rate limit with 15-minute backoff

Installation

Install from PyPI:

$ pip install wc-scrape

or

$ pip3 install wc-scrape

(you may need to use sudo or --break-system-packages on some systems)

Usage

First, set up your Twitter Bearer Token:

$ wc-scrape setup

Fetching Tweets

Fetch the latest tweets from a user:

$ wc-scrape fetch-tweets <username> <count>

This will save the tweets to a JSON file.

To generate a text file output, use the --to-txt flag when fetching tweets:

$ wc-scrape fetch-tweets <username> <count> --to-txt

To retry on rate limit with a 15-minute backoff, use the --retry flag:

$ wc-scrape fetch-tweets <username> <count> --retry

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wc_scrape-0.2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wc_scrape-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file wc_scrape-0.2.0.tar.gz.

File metadata

  • Download URL: wc_scrape-0.2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for wc_scrape-0.2.0.tar.gz
Algorithm Hash digest
SHA256 94434dca4cfe2361e5fd78381986c32fa800fceff036350b7a81c69c58690038
MD5 a4405462e1cfd8141f7a7f5f1725ece4
BLAKE2b-256 4253e5345ef66a96eec6171360e9149c2ba72ca4fcc2352f47042d24af068806

See more details on using hashes here.

File details

Details for the file wc_scrape-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: wc_scrape-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for wc_scrape-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdc1c7350a49800ded8894dd92c902b6572bcd1e6ab1475d4823ee43d6831617
MD5 29997463e95dbe8b17eb8de0d63408d3
BLAKE2b-256 6924fe6f1f2725f053fb791d4c131cbf2da99f5370522a3ea67b4bed46f59330

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page