大殺器代碼公開
import requests
import json
def get_review():
webPage = requests.get("https://api.codemao.cn/web/forums/posts/"+post_number+"/details")
reviews = requests.get("https://api.codemao.cn/web/forums/posts/"+post_number+"/replies?page=1&limit=10&sort=-created_at")
post_text = json.loads(webPage.text)
try:
post_id = post_text['id']
except KeyError:
print("帖號"+post_number+"不存在")
return
poster = int(post_text['user']['id'])
post_reviews = json.loads(reviews.text)['items']
for i in range(len(post_reviews)):
post_reviewer = int(post_reviews[i]['user']['id'])
#print(post_reviewer)
if post_reviewer == 805002:
print("野生的難起出現(xiàn)了!帖號:"+post_id+"\n\n\n")
if post_reviewer == 18591194:
print("野生的145帝出現(xiàn)了!帖號:"+post_id+"\n\n\n")
#print(post_id,poster)
if poster == 805002:
print("野生的難起出現(xiàn)了!帖號:"+post_id+"\n\n\n")
if poster == 18591194:
print("野生的145帝出現(xiàn)了!帖號:"+post_id+"\n\n\n")
"""
if poster == 4444262:
print("野生的叉子出現(xiàn)了!帖號:"+post_id+"\n\n\n")
"""
#print(post_text)
#print("\n\n\n")
#print(post_reviews)
global post_number
post_number = "476000"
for i in range(500):
post_number = int(post_number)
post_number += 1
post_number = str(post_number)
get_review()