ShrinkUrl: Remove xrl.us

> Please note: Adding new links has been disabled since September 2014
> after 14 months notice.

Source: http://metamark.net/
This commit is contained in:
nyuszika7h 2015-01-24 19:33:33 +01:00
parent 21cfa58a51
commit 1d722f9c30
7 changed files with 64 additions and 110 deletions

View File

@ -42,11 +42,11 @@ def configure(advanced):
conf.supybot.plugins.ShrinkUrl.shrinkSnarfer.setValue(True) conf.supybot.plugins.ShrinkUrl.shrinkSnarfer.setValue(True)
class ShrinkService(registry.OnlySomeStrings): class ShrinkService(registry.OnlySomeStrings):
"""Valid values include 'ln', 'tiny', 'xrl', 'goo', 'ur1', and 'x0'.""" """Valid values include 'ln', 'tiny', 'goo', 'ur1', and 'x0'."""
validStrings = ('ln', 'tiny', 'xrl', 'goo', 'ur1', 'x0') validStrings = ('ln', 'tiny', 'goo', 'ur1', 'x0')
class ShrinkCycle(registry.SpaceSeparatedListOfStrings): 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 Value = ShrinkService
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):

View File

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Limnoria\n" "Project-Id-Version: Limnoria\n"
"POT-Creation-Date: 2014-12-20 11:59+EET\n" "POT-Creation-Date: 2015-01-24 19:31+CET\n"
"PO-Revision-Date: 2014-12-20 12:21+0200\n" "PO-Revision-Date: 2015-01-24 19:31+0100\n"
"Last-Translator: Mikaela Suomalainen <mikaela.suomalainen@outlook.com>\n" "Last-Translator: Mikaela Suomalainen <mikaela.suomalainen@outlook.com>\n"
"Language-Team: suomi <>\n" "Language-Team: suomi <>\n"
"Language: fi\n" "Language: fi\n"
@ -28,8 +28,8 @@ msgstr ""
" tämän kaappaajan olevan käytössä?" " tämän kaappaajan olevan käytössä?"
#: config.py:45 config.py:49 #: config.py:45 config.py:49
msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', 'ur1', and 'x0'." msgid "Valid values include 'ln', 'tiny', 'goo', 'ur1', and 'x0'."
msgstr "Kelvolliset arvot ovat 'ln', 'tiny', 'xrl', 'goo', 'ur1' ja 'x0' ." msgstr "Kelvolliset arvot ovat 'ln', 'tiny', 'goo', 'ur1' ja 'x0' ."
#: config.py:70 #: config.py:70
msgid "" msgid ""
@ -145,19 +145,7 @@ msgstr ""
"osoitteesta>.\n" "osoitteesta>.\n"
" " " "
#: plugin.py:248 #: plugin.py:252
msgid ""
"<url>\n"
"\n"
" Returns an xrl.us version of <url>.\n"
" "
msgstr ""
"<URL-osoite>\n"
"\n"
" Palauttaa xrl.us palvelun lyhentämän version <URL-osoitteesta>.\n"
" "
#: plugin.py:281
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -168,7 +156,7 @@ msgstr ""
"\n" "\n"
" Palauttaa goo.gl-palvelun lyhentämän version <URL-osoitteesta>." " Palauttaa goo.gl-palvelun lyhentämän version <URL-osoitteesta>."
#: plugin.py:311 #: plugin.py:282
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -179,7 +167,7 @@ msgstr ""
" Palauttaa ur1-version <url:stä>.\n" " Palauttaa ur1-version <url:stä>.\n"
" " " "
#: plugin.py:338 #: plugin.py:309
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -191,7 +179,7 @@ msgstr ""
" Palauttaa x0.no palvelun lyhentämän version <URL-osoitteesta>.\n" " Palauttaa x0.no palvelun lyhentämän version <URL-osoitteesta>.\n"
" " " "
#: plugin.py:365 #: plugin.py:336
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -202,5 +190,16 @@ msgstr ""
" Palauttaa laajennetun version <url-osoitteesta>.\n" " Palauttaa laajennetun version <url-osoitteesta>.\n"
" " " "
#~ msgid ""
#~ "<url>\n"
#~ "\n"
#~ " Returns an xrl.us version of <url>.\n"
#~ " "
#~ msgstr ""
#~ "<URL-osoite>\n"
#~ "\n"
#~ " Palauttaa xrl.us palvelun lyhentämän version <URL-osoitteesta>.\n"
#~ " "
#~ msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', and 'x0'." #~ msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', and 'x0'."
#~ msgstr "Kelvolliset arvot ovat 'ln', 'tiny', 'xrl', 'goo' ja 'x0' ." #~ msgstr "Kelvolliset arvot ovat 'ln', 'tiny', 'xrl', 'goo' ja 'x0' ."

View File

@ -1,8 +1,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Limnoria\n" "Project-Id-Version: Limnoria\n"
"POT-Creation-Date: 2014-12-20 11:59+EET\n" "POT-Creation-Date: 2015-01-24 19:31+CET\n"
"PO-Revision-Date: \n" "PO-Revision-Date: 2015-01-24 19:32+0100\n"
"Last-Translator: Valentin Lorentz <progval@gmail.com>\n" "Last-Translator: Valentin Lorentz <progval@gmail.com>\n"
"Language-Team: Limnoria <progval@gmail.com>\n" "Language-Team: Limnoria <progval@gmail.com>\n"
"Language: \n" "Language: \n"
@ -23,9 +23,9 @@ msgstr ""
"snarfer ?" "snarfer ?"
#: config.py:45 config.py:49 #: config.py:45 config.py:49
msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', 'ur1', and 'x0'." msgid "Valid values include 'ln', 'tiny', 'goo', 'ur1', and 'x0'."
msgstr "" msgstr ""
"Les valeurs valides incluent 'ln', 'tiny', 'xrl', 'goo', 'ur1', et 'x0'." "Les valeurs valides incluent 'ln', 'tiny', 'goo', 'ur1', et 'x0'."
#: config.py:70 #: config.py:70
msgid "" msgid ""
@ -125,18 +125,7 @@ msgstr ""
"\n" "\n"
"Retourne une version de TinyURL.com de l'<url>." "Retourne une version de TinyURL.com de l'<url>."
#: plugin.py:248 #: plugin.py:252
msgid ""
"<url>\n"
"\n"
" Returns an xrl.us version of <url>.\n"
" "
msgstr ""
"<url>\n"
"\n"
"Retourne une version de xrl.us de l'<url>."
#: plugin.py:281
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -147,7 +136,7 @@ msgstr ""
"\n" "\n"
"Retourne une version de goo.gl de l'<url>." "Retourne une version de goo.gl de l'<url>."
#: plugin.py:311 #: plugin.py:282
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -158,7 +147,7 @@ msgstr ""
"\n" "\n"
"Retourne une version de ur1 de l'<url>." "Retourne une version de ur1 de l'<url>."
#: plugin.py:338 #: plugin.py:309
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -169,7 +158,7 @@ msgstr ""
"\n" "\n"
"Retourne une version de x0.no de l'<url>." "Retourne une version de x0.no de l'<url>."
#: plugin.py:365 #: plugin.py:336
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -180,5 +169,15 @@ msgstr ""
"\n" "\n"
"Retourne la version large de l'<url>." "Retourne la version large de l'<url>."
#~ msgid ""
#~ "<url>\n"
#~ "\n"
#~ " Returns an xrl.us version of <url>.\n"
#~ " "
#~ msgstr ""
#~ "<url>\n"
#~ "\n"
#~ "Retourne une version de xrl.us de l'<url>."
#~ msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', and 'x0'." #~ msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', and 'x0'."
#~ msgstr "Les valeurs valides incluent 'ln', 'tiny', 'xrl', 'goo', et 'x0'." #~ msgstr "Les valeurs valides incluent 'ln', 'tiny', 'xrl', 'goo', et 'x0'."

View File

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Limnoria\n" "Project-Id-Version: Limnoria\n"
"POT-Creation-Date: 2014-12-20 11:59+EET\n" "POT-Creation-Date: 2015-01-24 19:31+CET\n"
"PO-Revision-Date: 2015-01-24 11:45+0100\n" "PO-Revision-Date: 2015-01-24 11:45+0100\n"
"Last-Translator: skizzhg <skizzhg@gmx.com>\n" "Last-Translator: skizzhg <skizzhg@gmx.com>\n"
"Language-Team: Italian <skizzhg@gmx.com>\n" "Language-Team: Italian <skizzhg@gmx.com>\n"
@ -21,9 +21,9 @@ msgstr ""
#: config.py:45 config.py:49 #: config.py:45 config.py:49
#, fuzzy #, fuzzy
msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', 'ur1', and 'x0'." msgid "Valid values include 'ln', 'tiny', 'goo', 'ur1', and 'x0'."
msgstr "" msgstr ""
"I valori validi comprendono \"ln\", \"tiny\", \"xrl\", \"goo\" e \"x0\"." "I valori validi comprendono \"ln\", \"tiny\", \"goo\" e \"x0\"."
#: config.py:70 #: config.py:70
msgid "" msgid ""
@ -132,19 +132,7 @@ msgstr ""
" Restituisce una versione di TinyURL.com di <url>\n" " Restituisce una versione di TinyURL.com di <url>\n"
" " " "
#: plugin.py:248 #: plugin.py:252
msgid ""
"<url>\n"
"\n"
" Returns an xrl.us version of <url>.\n"
" "
msgstr ""
"<url>\n"
"\n"
" Restituisce una versione di xrl.us di <url>.\n"
" "
#: plugin.py:281
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -156,7 +144,7 @@ msgstr ""
" Restituisce una versione di goo.gl di <url>.\n" " Restituisce una versione di goo.gl di <url>.\n"
" " " "
#: plugin.py:311 #: plugin.py:282
#, fuzzy #, fuzzy
msgid "" msgid ""
"<url>\n" "<url>\n"
@ -169,7 +157,7 @@ msgstr ""
" Restituisce una versione di xrl.us di <url>.\n" " Restituisce una versione di xrl.us di <url>.\n"
" " " "
#: plugin.py:338 #: plugin.py:309
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -181,7 +169,7 @@ msgstr ""
" Restituisce una versione di x0.no di <url>.\n" " Restituisce una versione di x0.no di <url>.\n"
" " " "
#: plugin.py:365 #: plugin.py:336
#, fuzzy #, fuzzy
msgid "" msgid ""
"<url>\n" "<url>\n"
@ -193,3 +181,14 @@ msgstr ""
"\n" "\n"
" Restituisce una versione di x0.no di <url>.\n" " Restituisce una versione di x0.no di <url>.\n"
" " " "
#~ msgid ""
#~ "<url>\n"
#~ "\n"
#~ " Returns an xrl.us version of <url>.\n"
#~ " "
#~ msgstr ""
#~ "<url>\n"
#~ "\n"
#~ " Restituisce una versione di xrl.us di <url>.\n"
#~ " "

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2014-12-20 11:59+EET\n" "POT-Creation-Date: 2015-01-24 19:31+CET\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -24,7 +24,7 @@ msgstr ""
#: config.py:45 config.py:49 #: config.py:45 config.py:49
#, docstring #, docstring
msgid "Valid values include 'ln', 'tiny', 'xrl', 'goo', 'ur1', and 'x0'." msgid "Valid values include 'ln', 'tiny', 'goo', 'ur1', and 'x0'."
msgstr "" msgstr ""
#: config.py:70 #: config.py:70
@ -106,16 +106,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:248 #: plugin.py:252
#, docstring
msgid ""
"<url>\n"
"\n"
" Returns an xrl.us version of <url>.\n"
" "
msgstr ""
#: plugin.py:281
#, docstring #, docstring
msgid "" msgid ""
"<url>\n" "<url>\n"
@ -124,7 +115,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:311 #: plugin.py:282
#, docstring #, docstring
msgid "" msgid ""
"<url>\n" "<url>\n"
@ -133,7 +124,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:338 #: plugin.py:309
#, docstring #, docstring
msgid "" msgid ""
"<url>\n" "<url>\n"
@ -142,7 +133,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:365 #: plugin.py:336
#, docstring #, docstring
msgid "" msgid ""
"<url>\n" "<url>\n"

View File

@ -229,35 +229,6 @@ class ShrinkUrl(callbacks.PluginRegexp):
irc.errorPossibleBug(str(e)) irc.errorPossibleBug(str(e))
tiny = thread(wrap(tiny, ['url'])) tiny = thread(wrap(tiny, ['url']))
_xrlApi = 'http://metamark.net/api/rest/simple'
@retry
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).decode()
if text.startswith('ERROR:'):
raise ShrinkError(text[6:])
self.db.set('xrl', quotedurl, text)
return text
@internationalizeDocstring
def xrl(self, irc, msg, args, url):
"""<url>
Returns an xrl.us version of <url>.
"""
try:
xrlurl = self._getXrlUrl(url)
m = irc.reply(xrlurl)
if m is not None:
m.tag('shrunken')
except ShrinkError as e:
irc.error(str(e))
xrl = thread(wrap(xrl, ['url']))
_gooApi = 'https://www.googleapis.com/urlshortener/v1/url' _gooApi = 'https://www.googleapis.com/urlshortener/v1/url'
@retry @retry
def _getGooUrl(self, url): def _getGooUrl(self, url):

View File

@ -41,8 +41,6 @@ class ShrinkUrlTestCase(ChannelPluginTestCase):
(udUrl, r'http://tinyurl.com/u479')], (udUrl, r'http://tinyurl.com/u479')],
'ln': [(sfUrl, r'http://ln-s.net/\+PE-'), 'ln': [(sfUrl, r'http://ln-s.net/\+PE-'),
(udUrl, r'http://ln-s.net/2\$K')], (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'), 'goo': [(sfUrl, r'http://goo.gl/3c59N'),
(udUrl, r'http://goo.gl/ocTga')], (udUrl, r'http://goo.gl/ocTga')],
'ur1': [(sfUrl, r'http://ur1.ca/9xl25'), 'ur1': [(sfUrl, r'http://ur1.ca/9xl25'),
@ -98,9 +96,6 @@ class ShrinkUrlTestCase(ChannelPluginTestCase):
def testLnsnarf(self): def testLnsnarf(self):
self._snarf('ln') self._snarf('ln')
def testXrlsnarf(self):
self._snarf('xrl')
def testGoosnarf(self): def testGoosnarf(self):
self._snarf('goo') self._snarf('goo')