Files
C.E.L_Slide_test2/.orchestrator/tmp/fetch7.py
T

17 lines
636 B
Python

import json, urllib.request, ssl, os, sys
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
req = urllib.request.Request(
'https://gitea.hmac.kr/api/v1/repos/Kyeongmin/C.E.L_Slide_test2/issues/7/comments',
headers={'Authorization': 'token ' + os.environ.get('GITEA_TOKEN', '')},
)
sys.stdout.reconfigure(encoding='utf-8')
r = urllib.request.urlopen(req, context=ctx, timeout=30)
data = json.loads(r.read())
for c in data:
if c.get('id') in (19226, 19240):
print('=== id', c['id'], 'created_at', c.get('created_at'), '===')
print(c.get('body', ''))
print()