import urllib2
import logging


from lala.util import msg, command
from twisted.web.client import getPage

DFEOOJM_URL = "http://www.downforeveryoneorjustme.com/%s"

@command
def isitdown(user, channel, text):
    def callback(content):
        if "It's just you" in content:
            msg(channel, "%s: It's just you!" % user)
        else:
            msg(channel, "%s: It's not just you!" % user)

    s_text = text.split()
    if len(s_text) <= 1:
        return
    website = DFEOOJM_URL % " ".join(s_text[1:])
    logging.debug("Trying to open %s" % website)
    d = getPage(str(website))
    d.addCallback(callback)
    return d

@@ -1,19 +1,4 @@
-import urllib2%0A
 impo
@@ -83,16 +83,67 @@
  getPage
+%0Afrom twisted.internet.defer import inlineCallbacks
 %0A%0ADFEOOJ
@@ -195,16 +195,17 @@
 om/%25s%22%0A%0A
+%0A
 @command
@@ -205,16 +205,33 @@
 command%0A
+@inlineCallbacks%0A
 def isit
@@ -261,201 +261,8 @@
 t):%0A
-    def callback(content):%0A        if %22It's just you%22 in content:%0A            msg(channel, %22%25s: It's just you!%22 %25 user)%0A        else:%0A            msg(channel, %22%25s: It's not just you!%22 %25 user)%0A%0A
     
@@ -429,11 +429,23 @@
     
-d =
+content = yield
  get
@@ -471,41 +471,149 @@
     
-d.addCallback(callback)%0A    return d
+if %22It's just you%22 in content:%0A        msg(channel, %22%25s: It's just you!%22 %25 user)%0A    else:%0A        msg(channel, %22%25s: It's not just you!%22 %25 user)
 %0A

Use inlineCallbacks