From 8266870d9f41f4a76f6c1ef0eb01122a11623efe Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Sat, 24 Jan 2015 19:33:33 +0100 Subject: [PATCH] ShrinkUrl: Remove xrl.us > Please note: Adding new links has been disabled since September 2014 > after 14 months notice. Source: http://metamark.net/ Signed-off-by: James McCoy --- plugins/ShrinkUrl/config.py | 6 +++--- plugins/ShrinkUrl/plugin.py | 27 --------------------------- plugins/ShrinkUrl/test.py | 5 ----- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/plugins/ShrinkUrl/config.py b/plugins/ShrinkUrl/config.py index bb9c7338d..8229106f5 100644 --- a/plugins/ShrinkUrl/config.py +++ b/plugins/ShrinkUrl/config.py @@ -40,11 +40,11 @@ def configure(advanced): conf.supybot.plugins.ShrinkUrl.shrinkSnarfer.setValue(True) class ShrinkService(registry.OnlySomeStrings): - """Valid values include 'ln', 'tiny', 'xrl', 'goo', 'ur1', and 'x0'.""" - validStrings = ('ln', 'tiny', 'xrl', 'goo', 'ur1', 'x0') + """Valid values include 'ln', 'tiny', 'goo', 'ur1', and 'x0'.""" + validStrings = ('ln', 'tiny', 'goo', 'ur1', 'x0') class ShrinkCycle(registry.SpaceSeparatedListOfStrings): - """Valid values include 'ln', 'tiny', 'xrl', 'goo', 'ur1', and 'x0'.""" + """Valid values include 'ln', 'tiny', 'goo', 'ur1', and 'x0'.""" Value = ShrinkService def __init__(self, *args, **kwargs): diff --git a/plugins/ShrinkUrl/plugin.py b/plugins/ShrinkUrl/plugin.py index dce4575dd..17903d6a7 100644 --- a/plugins/ShrinkUrl/plugin.py +++ b/plugins/ShrinkUrl/plugin.py @@ -201,33 +201,6 @@ class ShrinkUrl(callbacks.PluginRegexp): irc.errorPossibleBug(str(e)) tiny = thread(wrap(tiny, ['url'])) - _xrlApi = 'http://metamark.net/api/rest/simple' - def _getXrlUrl(self, url): - quotedurl = utils.web.urlquote(url) - try: - return self.db.get('xrl', quotedurl) - except KeyError: - data = utils.web.urlencode({'long_url': url}) - text = utils.web.getUrl(self._xrlApi, data=data) - if text.startswith('ERROR:'): - raise ShrinkError, text[6:] - self.db.set('xrl', quotedurl, text) - return text - - def xrl(self, irc, msg, args, url): - """ - - Returns an xrl.us version of . - """ - try: - xrlurl = self._getXrlUrl(url) - m = irc.reply(xrlurl) - if m is not None: - m.tag('shrunken') - except ShrinkError, e: - irc.error(str(e)) - xrl = thread(wrap(xrl, ['url'])) - _gooApi = 'https://www.googleapis.com/urlshortener/v1/url' def _getGooUrl(self, url): url = utils.web.urlquote(url) diff --git a/plugins/ShrinkUrl/test.py b/plugins/ShrinkUrl/test.py index 1b3a7aa40..7f1c0208e 100644 --- a/plugins/ShrinkUrl/test.py +++ b/plugins/ShrinkUrl/test.py @@ -41,8 +41,6 @@ class ShrinkUrlTestCase(ChannelPluginTestCase): (udUrl, r'http://tinyurl.com/u479')], 'ln': [(sfUrl, r'http://ln-s.net/4LVF'), (udUrl, r'http://ln-s.net/2\$K')], - 'xrl': [(sfUrl, r'http://xrl.us/bfq8ik'), - (udUrl, r'http://xrl.us/bfnyji')], 'goo': [(sfUrl, r'http://goo.gl/3c59N'), (udUrl, r'http://goo.gl/ocTga')], 'ur1': [(sfUrl, r'http://ur1.ca/9xl25'), @@ -98,9 +96,6 @@ class ShrinkUrlTestCase(ChannelPluginTestCase): def testLnsnarf(self): self._snarf('ln') - def testXrlsnarf(self): - self._snarf('xrl') - def testGoosnarf(self): self._snarf('goo')