WIP on !w3c action
This commit is contained in:
parent
073f34af26
commit
6641763c12
|
@ -16,6 +16,7 @@ def load(context):
|
|||
add_hook("cmd_hook", Hook(cmd_traceurl, "traceurl"))
|
||||
add_hook("cmd_hook", Hook(cmd_isup, "isup"))
|
||||
add_hook("cmd_hook", Hook(cmd_curl, "curl"))
|
||||
add_hook("cmd_hook", Hook(cmd_w3c, "w3c"))
|
||||
|
||||
|
||||
def help_tiny ():
|
||||
|
@ -117,3 +118,12 @@ def traceURL(url, timeout=5, stack=None):
|
|||
return traceURL(url, timeout, stack)
|
||||
else:
|
||||
return stack
|
||||
|
||||
|
||||
VALIDATOR_URL = 'http://validator.w3.org/check?output=soap12&uri='
|
||||
|
||||
def cmd_w3c(msg):
|
||||
if len(msg.cmds) > 1:
|
||||
req = web.getXML(VALIDATOR_URL + quote(" ".join(msg.cmds[1:])))
|
||||
print (req)
|
||||
print (req.getFirstNode("env:Body").getFirstNode("m:markupvalidationresponse").getFirstNode("m:uri").getContent())
|
||||
|
|
Loading…
Reference in New Issue