Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions twitter_scraper/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Configuration constants for TwitterDataScraper."""
from __future__ import annotations

import os

TWITTER_LOGIN_URL = "https://twitter.com/i/flow/login"
TWITTER_BASE_URL = "https://twitter.com"
Expand All @@ -24,8 +26,6 @@
PROFILE_HREF_PATTERN = r"^/[A-Za-z0-9_]{1,15}$"

# User agent (Chrome 131 - January 2025)
USER_AGENT = (
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/131.0.0.0 Safari/537.36"
)
USER_AGENT_ENV_VAR = os.getenv('TWITTER_USER_AGENT', "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36")

USER_AGENT = USER_AGENT_ENV_VAR