"""
isup.py - Simple website status check with isup.me
Author: Edward Powell http://embolalia.net
About: http://willie.dftba.net

This allows users to check if a website is up through isup.me.
"""

import willie.web as web
import re

def isup(willie, trigger):
    """isup.me website status checker"""
    site = trigger.group(2)
    if not site:
        return willie.reply("What site do you want to check?")
    uri = 'http://www.isup.me/' + site
    try:
        response = web.get(uri)
    except Exception as e:
        willie.say(site + ' is ' + str(e))
        return
    result = re.search('(?:<title>)(http://\S* Is )(Down|Up)',\
                       response)
    if result:
        willie.say(site + ' is ' + result.group(2))
    else:
        willie.say('Couldn\'t read the result from isup.me -- sorry!')
isup.commands = ['isup']

@@ -407,37 +407,258 @@
 ?%22)%0A
+%0A
     
-uri 
+if site%5B:6%5D != 'http://' and site%5B:7%5D !
 = 'http
+s
 ://
-www.isup.me
+':%0A        if '://' in site:%0A            protocol = site.split('://')%5B0%5D + '://'%0A            return willie.reply(%22Try it again without the %25s%22 %25 protocol)%0A        else:%0A            site = 'http:/
 /' +
@@ -703,11 +703,12 @@
 get(
-uri
+site
 )%0A  
@@ -764,148 +764,63 @@
 + ' 
-is ' + str(e))%0A        return%0A    result = re.search('(?:%3Ctitle%3E)(http://%5CS* Is )(Down%7CUp)',%5C%0A                       response)%0A    if result
+looks down from here.')%0A        return%0A%0A    if response
 :%0A  
@@ -849,30 +849,26 @@
 + ' 
-is ' + result.group(2)
+looks fine to me.'
 )%0A  
@@ -898,57 +898,35 @@
 say(
-'Couldn%5C't read the result from isup.me -- sorry!
+site + ' is down from here.
 ')%0Ai

Use our own web stuff to see if sites are up, rather than scraping isup.me