Merge pull request #339 from jesopo/launchd/rm-git-shortener
Remove support for `git.io` shortening
This commit is contained in:
commit
d58a77ecb9
2 changed files with 8 additions and 17 deletions
|
@ -175,14 +175,9 @@ class GitHub(object):
|
||||||
return list(zip(out, [None]*len(out)))
|
return list(zip(out, [None]*len(out)))
|
||||||
|
|
||||||
def _short_url(self, url):
|
def _short_url(self, url):
|
||||||
self.log.debug("git.io shortening: %s" % url)
|
# TODO: find an alternative to git.io
|
||||||
try:
|
# see https://github.com/jesopo/bitbot/issues/338
|
||||||
page = utils.http.request("https://git.io", method="POST",
|
# ~ examknow 1/19/2022
|
||||||
post_data={"url": url})
|
|
||||||
return page.headers["Location"]
|
|
||||||
except utils.http.HTTPTimeoutException:
|
|
||||||
self.log.warn(
|
|
||||||
"HTTPTimeoutException while waiting for github short URL", [])
|
|
||||||
return url
|
return url
|
||||||
|
|
||||||
def _iso8601(self, s):
|
def _iso8601(self, s):
|
||||||
|
|
|
@ -47,13 +47,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
return org, repo, number
|
return org, repo, number
|
||||||
|
|
||||||
def _short_url(self, url):
|
def _short_url(self, url):
|
||||||
try:
|
# TODO: find an alternative to git.io
|
||||||
page = utils.http.request("https://git.io", method="POST",
|
# see https://github.com/jesopo/bitbot/issues/338
|
||||||
post_data={"url": url})
|
# ~ examknow 1/19/2022
|
||||||
return page.headers["Location"]
|
|
||||||
except utils.http.HTTPTimeoutException:
|
|
||||||
self.log.warn(
|
|
||||||
"HTTPTimeoutException while waiting for github short URL", [])
|
|
||||||
return url
|
return url
|
||||||
|
|
||||||
def _change_count(self, n, symbol, color):
|
def _change_count(self, n, symbol, color):
|
||||||
|
|
Loading…
Reference in a new issue