mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 15:40:26 +01:00
add rate log
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
6394006bc1
commit
bc54262db6
1 changed files with 12 additions and 3 deletions
|
|
@ -203,8 +203,12 @@ for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UsersApi, pt.UserListApi]:
|
||||||
try:
|
try:
|
||||||
logger.info(f"Try: Self UserByScreenName Test")
|
logger.info(f"Try: Self UserByScreenName Test")
|
||||||
kwargs = get_kwargs("UserByScreenName", {"screen_name": "a810810931931"})
|
kwargs = get_kwargs("UserByScreenName", {"screen_name": "a810810931931"})
|
||||||
res = pt.UserApi(api_client).get_user_by_screen_name(**kwargs).to_dict()
|
res = pt.UserApi(api_client).get_user_by_screen_name_with_http_info(**kwargs)
|
||||||
if not res["data"]["user"]["result"]["legacy"]["screen_name"] == "a810810931931":
|
data = res.data.to_dict()
|
||||||
|
|
||||||
|
rate = match_rate(data, json.loads(res.raw_data))
|
||||||
|
logger.info(f"Match rate: {rate}")
|
||||||
|
if not data["data"]["user"]["result"]["legacy"]["screen_name"] == "a810810931931":
|
||||||
raise Exception("UserByScreenName failed")
|
raise Exception("UserByScreenName failed")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error_dump(e)
|
error_dump(e)
|
||||||
|
|
@ -213,7 +217,12 @@ except Exception as e:
|
||||||
try:
|
try:
|
||||||
logger.info(f"Try: Self UserTweets Test")
|
logger.info(f"Try: Self UserTweets Test")
|
||||||
kwargs = get_kwargs("UserTweets", {"userId": "1180389371481976833"})
|
kwargs = get_kwargs("UserTweets", {"userId": "1180389371481976833"})
|
||||||
pt.TweetApi(api_client).get_user_tweets(**kwargs)
|
res = pt.TweetApi(api_client).get_user_tweets_with_http_info(**kwargs)
|
||||||
|
data = res.data.to_dict()
|
||||||
|
|
||||||
|
rate = match_rate(data, json.loads(res.raw_data))
|
||||||
|
logger.info(f"Match rate: {rate}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error_dump(e)
|
error_dump(e)
|
||||||
error_count += 1
|
error_count += 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue