gpt4 book ai didi

stackexchange-api - 如何使用 StackExchange API 从用户个人资料页面获取 "top x% this y"?

转载 作者:行者123 更新时间:2023-12-04 07:24:05 30 4
gpt4 key购买 nike

使用 the StackExchange API ,有可能找到很多关于用户的信息:

{
"badge_counts": {
"bronze": 3,
"silver": 2,
"gold": 1
},
"view_count": 1000,
"down_vote_count": 50,
"up_vote_count": 90,
"answer_count": 10,
"question_count": 12,
"account_id": 1,
"is_employee": false,
"last_modified_date": 1625694512,
"last_access_date": 1625737712,
"reputation_change_year": 9001,
"reputation_change_quarter": 400,
"reputation_change_month": 200,
"reputation_change_week": 800,
"reputation_change_day": 100,
"reputation": 9001,
"creation_date": 1625694512,
"user_type": "registered",
"user_id": 1,
"accept_rate": 55,
"about_me": "about me block",
"location": "An Imaginary World",
"website_url": "http://example.com/",
"link": "http://example.stackexchange.com/users/1/example-user",
"profile_image": "https://www.gravatar.com/avatar/a007be5a61f6aa8f3e85ae2fc18dd66e?d=identicon&r=PG",
"display_name": "Example User"
}
此外,我想获取您在事件概览中的总声誉旁边找到的字符串,例如,
top 5.43% this year
是否可以使用 API 以某种方式获取它?

最佳答案

都没有 the SE API也不是 SEDE提供这样的领域。相反,你可以

GET /users/rank?userId=<userId>
然后解析返回的 HTML 以获得所需的百分比。对于您( ?user=353337 ),它看起来像这样:

<a href="https://stackexchange.com/leagues/1/year/stackoverflow/2021-01-01/353337#353337" target="_blank">top <b>0.20%</b> this year</a>

关于stackexchange-api - 如何使用 StackExchange API 从用户个人资料页面获取 "top x% this y"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68309023/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com