Web: Remove netcraft (which does not seem to want bots).

This commit is contained in:
Valentin Lorentz 2013-01-05 19:14:58 +01:00
parent 63a4285941
commit 2177429618
2 changed files with 0 additions and 27 deletions

View File

@ -208,30 +208,6 @@ class Web(callbacks.PluginRegexp):
'within the first %S.'), size))
title = wrap(title, [getopts({'no-filter': ''}), 'httpUrl'])
_netcraftre = re.compile(r'td align="left">\s+<a[^>]+>(.*?)<a href',
re.S | re.I)
@internationalizeDocstring
def netcraft(self, irc, msg, args, hostname):
"""<hostname|ip>
Returns Netcraft.com's determination of what operating system and
webserver is running on the host given.
"""
url = 'http://uptime.netcraft.com/up/graph/?host=' + hostname
html = utils.web.getUrl(url) \
.decode('utf8')
m = self._netcraftre.search(html)
if m:
html = m.group(1)
s = utils.web.htmlToText(html, tagReplace='').strip()
s = s.rstrip('-').strip()
irc.reply(s) # Snip off "the site"
elif 'We could not get any results' in html:
irc.reply(_('No results found for %s.') % hostname)
else:
irc.error(_('The format of page the was odd.'))
netcraft = wrap(netcraft, ['text'])
@internationalizeDocstring
def urlquote(self, irc, msg, args, text):
"""<text>

View File

@ -71,9 +71,6 @@ class WebTestCase(ChannelPluginTestCase):
self.assertNotError(
'title http://www.youtube.com/watch?v=x4BtiqPN4u8')
def testNetcraft(self):
self.assertNotError('netcraft slashdot.org')
def testTitleSnarfer(self):
try:
conf.supybot.plugins.Web.titleSnarfer.setValue(True)