Вот мой код:
Код: Выделить всё
owner = "tensorflow"
repo = "tensorflow"
n_comments = 250
url = f"https://api.github.com/repos/{owner}/{repo}/issues"
token = "mytokenhere"
params = {
'sort':'comments-desc',
'q': 'comments:>{n_comments}',
}
headers = {
"Authorization": f"token {token}",
"Accept": "application/vnd.github.v3+json" # specifying json-formatted data
}
response = requests.get(url, headers = headers, params = params)
issues_with_sufficient_comments = []
if response.status_code == 200:
# Extract the JSON data
data = response.json()
for item in data:
issues_with_sufficient_comments.append(item['number'])
print(item['number'])
print(item['comments'])
else:
# Print error message if request failed
print(f"Error: {response.status_code}")
url = f"https://api.github.com/repos/{owner}/{r ... ments:>250 ", что тоже не помогло
Подробнее здесь: https://stackoverflow.com/questions/784 ... search-api