Skip to main content

CLI to fetch tweets from X using your Chrome session

Project description

hawkx

CLI to fetch tweets from X using your Chrome session. No API key — uses your logged-in Chrome cookies.

Requirement: Be logged into x.com in Chrome.

Disclaimer

This tool automates access to X using your own browser session. You are responsible for complying with X's Terms of Service and acceptable use policies. Use at your own risk. The authors do not endorse or encourage any use that violates X's policies.

Setup

pip install -r requirements.txt

Or from source:

pip install -e .

Usage

hawkx getuser <name> [number]             # e.g. hawkx getuser elonmusk 20
hawkx getuser elonmusk 100 -R -I -t       # 100 posts, replies, images, text only
hawkx getpost <post_id> [-R] [-I]         # -R include replies, -I include image URLs
hawkx getbookmarks [number] [-R] [-I]
hawkx setprofile 'Profile 1'              # set Chrome profile (saved to ~/.hawkx/settings.json)

Run hawkx or hawkx help for command list.

Settings

Profile is stored in ~/.hawkx/settings.json:

{"profile": "Profile 1"}

Update with hawkx setprofile 'Profile 1'. Default is "1" (Profile 1).

Output

Default: JSON with id, text, created_at, user, favorites, retweets, replies. Add -I for images array, -R for reply metadata / reply thread. Use -t for text only.

SDK

from twitter.package import get_user_tweets, get_bookmarks, get_post, get_post_simple
entries = get_user_tweets("elonmusk", limit=40)

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

hawkx-0.1.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

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

hawkx-0.1.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file hawkx-0.1.0.tar.gz.

File metadata

  • Download URL: hawkx-0.1.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for hawkx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e9aa3f23ab2032902cab0499680757d5bc0b53e7aff20b4276a0d3368f5cde66
MD5 a8845e40f173e29fd80fb058d61250f5
BLAKE2b-256 d4b4c495beddc0481626caafd6256265f3522f500eee899ca0bc4b59d86d3750

See more details on using hashes here.

File details

Details for the file hawkx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hawkx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for hawkx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d16f48a1eeb0033a12f1f644d542941e811bd8b7d3792eb013dbef45dcda1b3
MD5 2e49e0fb15a2338b0fe63ed2da4fc22e
BLAKE2b-256 af60647c5301535b389a4250322feef16d9941d8d5ca4af3458c2e93d4ab1fb7

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