GitHub: Use ur1.ca instead of tinyurl.com.
parent
11bc5b7c84
commit
f29255f8bc
|
@ -62,9 +62,5 @@ conf.registerGlobalValue(GitHub, 'announces',
|
|||
registry.String('', _("""You shouldn't edit this configuration
|
||||
variable yourself, unless you know what you do. Use '@Github announce
|
||||
add' or '@Github announce remove' instead.""")))
|
||||
conf.registerChannelValue(GitHub, 'tiny',
|
||||
registry.String('http://tinyurl.com/api-create.php', _("""The URL
|
||||
used to tinyfy the commit link (must be compatible with TinyURL.com
|
||||
""")))
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
import json
|
||||
import time
|
||||
import ur1ca
|
||||
import urllib
|
||||
import socket
|
||||
import threading
|
||||
|
@ -101,9 +102,17 @@ class GitHub(callbacks.Plugin):
|
|||
def _createPrivmsg(self, channel, payload, commit):
|
||||
bold = ircutils.bold
|
||||
url = commit['url']
|
||||
data = urllib.urlencode({'url': url})
|
||||
tiny = instance.registryValue('tiny', channel)
|
||||
url = urllib.urlopen(tiny, data).read()
|
||||
|
||||
# ur1.ca
|
||||
post_param = ur1ca.parameterize(url)
|
||||
answerfile = ur1ca.request(post_param)
|
||||
doc = ur1ca.retrievedoc(answerfile)
|
||||
answerfile.close()
|
||||
status, url2 = ur1ca.scrape(doc)
|
||||
|
||||
if status:
|
||||
url = url2
|
||||
|
||||
s = '%s/%s (in %s): %s committed %s %s' % \
|
||||
(payload['repository']['owner']['name'],
|
||||
bold(payload['repository']['name']),
|
||||
|
|
Loading…
Reference in New Issue