mirror of
https://github.com/tomasriveral/nixpkgs-notifier.git
synced 2026-08-12 02:38:37 +02:00
fix: pycurl error
This commit is contained in:
+9
-2
@@ -37,13 +37,20 @@ DEFAULT_CONFIG = {
|
|||||||
"userPingServer": "matrix.org"
|
"userPingServer": "matrix.org"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def getPRTitle(PRnumber):
|
def getPRTitle(PRnumber):
|
||||||
buf = io.BytesIO()
|
buf = io.BytesIO()
|
||||||
with pycurl.Curl() as c:
|
|
||||||
c.setopt(c.URL, "https://api.github.com/repos/NixOS/nixpkgs/pulls/" + str(PRnumber))
|
c = pycurl.Curl()
|
||||||
|
c.setopt(
|
||||||
|
c.URL,
|
||||||
|
f"https://api.github.com/repos/NixOS/nixpkgs/pulls/{PRnumber}"
|
||||||
|
)
|
||||||
c.setopt(c.USERAGENT, "pycurl")
|
c.setopt(c.USERAGENT, "pycurl")
|
||||||
c.setopt(c.WRITEDATA, buf)
|
c.setopt(c.WRITEDATA, buf)
|
||||||
c.perform()
|
c.perform()
|
||||||
|
c.close()
|
||||||
|
|
||||||
return json.loads(buf.getvalue())["title"]
|
return json.loads(buf.getvalue())["title"]
|
||||||
|
|
||||||
def load_config():
|
def load_config():
|
||||||
|
|||||||
Reference in New Issue
Block a user