User API working again, with_tweets still broken. #284

This commit is contained in:
Dylan
2025-09-10 16:46:05 +01:00
parent 98196b0e30
commit cbf55e7429
4 changed files with 33 additions and 20 deletions

View File

@@ -4,18 +4,19 @@ from configHandler import config
from utils import stripEndTCO
def getApiUserResponse(user):
userResult = user["data"]["user"]["result"]
return {
"id": user["id"],
"screen_name": user["screen_name"],
"name": user["name"],
"profile_image_url": user["profile_image_url_https"],
"description": user["description"],
"location": user["location"],
"followers_count": user["followers_count"],
"following_count": user["friends_count"],
"tweet_count": user["statuses_count"],
"created_at": user["created_at"],
"protected": user["protected"],
"id": int(userResult["rest_id"]),
"screen_name": userResult["core"]["screen_name"],
"name": userResult["core"]["name"],
"profile_image_url": userResult['avatar']["image_url"],
"description": userResult["legacy"]["description"],
"location": userResult["location"]["location"],
"followers_count": userResult["legacy"]["followers_count"],
"following_count": userResult["legacy"]["friends_count"],
"tweet_count": userResult["legacy"]["statuses_count"],
"created_at": userResult["core"]["created_at"],
"protected": userResult["privacy"]["protected"],
"fetched_on": int(datetime.now().timestamp()),
}