Merge pull request #339 from jesopo/launchd/rm-git-shortener

Remove support for `git.io` shortening
This commit is contained in:
David Schultz 2022-01-20 11:30:40 -06:00 committed by GitHub
commit d58a77ecb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 17 deletions

View file

@ -175,15 +175,10 @@ class GitHub(object):
return list(zip(out, [None]*len(out)))
def _short_url(self, url):
self.log.debug("git.io shortening: %s" % url)
try:
page = utils.http.request("https://git.io", method="POST",
post_data={"url": url})
return page.headers["Location"]
except utils.http.HTTPTimeoutException:
self.log.warn(
"HTTPTimeoutException while waiting for github short URL", [])
return url
# TODO: find an alternative to git.io
# see https://github.com/jesopo/bitbot/issues/338
# ~ examknow 1/19/2022
return url
def _iso8601(self, s):
return utils.datetime.parse.iso8601(s)

View file

@ -47,14 +47,10 @@ class Module(ModuleManager.BaseModule):
return org, repo, number
def _short_url(self, url):
try:
page = utils.http.request("https://git.io", method="POST",
post_data={"url": url})
return page.headers["Location"]
except utils.http.HTTPTimeoutException:
self.log.warn(
"HTTPTimeoutException while waiting for github short URL", [])
return url
# TODO: find an alternative to git.io
# see https://github.com/jesopo/bitbot/issues/338
# ~ examknow 1/19/2022
return url
def _change_count(self, n, symbol, color):
return utils.irc.color("%s%d" % (symbol, n), color)+utils.irc.bold("")