MCPcopy
hub / github.com/521xueweihan/HelloGitHub / get_data

Function get_data

script/github_bot/github_bot.py:70–87  ·  view source on GitHub ↗

从目标源获取数据 https://developer.github.com/v3/activity/events/ GitHub 规定:默认每页 30 条,最多 300 条目

(page=1)

Source from the content-addressed store, hash-verified

68
69
70def get_data(page=1):
71 """
72 从目标源获取数据
73 https://developer.github.com/v3/activity/events/
74 GitHub 规定:默认每页 30 条,最多 300 条目
75 """
76
77 args = '?page={page}'.format(page=page)
78
79 response = requests.get(API['events']+args,
80 auth=(ACCOUNT['username'], ACCOUNT['password']))
81 status_code = response.status_code
82 if status_code == 200:
83 resp_json = response.json()
84 return resp_json
85 else:
86 logging.error('请求 event api 失败:', status_code)
87 return []
88
89
90def get_all_data():

Callers 1

get_all_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected