refactor: fix remaining code review issues on kabi-use
- _get_client: remove useless try/except that re-raised same error - verify_cookies: increase timeout from 3s to 5s - fetch_user: use _deep_get for URL extraction (consistent with _parse_user_result) - formatter: remove no-op tweets_to_json wrapper and unused import - _as_int/_as_float: filter.py now imports from config.py (dedup) - CLI read commands: extract _fetch_and_display() to dedup favorite/search/likes/list_timeline - _write_action: move load_config inside try block - auth.py: add PEP 8 blank line after logger
This commit is contained in:
@@ -311,11 +311,7 @@ class TwitterClient:
|
||||
screen_name=core.get("screen_name") or legacy.get("screen_name", screen_name),
|
||||
bio=legacy.get("description", ""),
|
||||
location=legacy.get("location", ""),
|
||||
url=(
|
||||
legacy.get("entities", {}).get("url", {}).get("urls", [{}])[0].get("expanded_url", "")
|
||||
if legacy.get("entities", {}).get("url")
|
||||
else ""
|
||||
),
|
||||
url=_deep_get(legacy, "entities", "url", "urls", 0, "expanded_url") or "",
|
||||
followers_count=_to_int(legacy.get("followers_count"), 0),
|
||||
following_count=_to_int(legacy.get("friends_count"), 0),
|
||||
tweets_count=_to_int(legacy.get("statuses_count"), 0),
|
||||
|
||||
Reference in New Issue
Block a user