summaryrefslogtreecommitdiffstats
path: root/web.py
diff options
context:
space:
mode:
authorSean B. Palmer <http://inamidst.com/sbp/>2008-09-11 17:18:44 +0100
committerSean B. Palmer <http://inamidst.com/sbp/>2008-09-11 17:18:44 +0100
commitb91de3886ecb38b6621dc35fa18a4c7f10fde780 (patch)
treebae59574d4d07b054907dfc207e28dc7768bf2fe /web.py
parent31d107c0bd7fa2e172b09cce9560f3a10c1091af (diff)
downloadbot-b91de3886ecb38b6621dc35fa18a4c7f10fde780.tar.gz
bot-b91de3886ecb38b6621dc35fa18a4c7f10fde780.tar.bz2
bot-b91de3886ecb38b6621dc35fa18a4c7f10fde780.zip
Added oblique.py, a new web services module.
Diffstat (limited to 'web.py')
-rwxr-xr-xweb.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/web.py b/web.py
index fff4a7f..31366f4 100755
--- a/web.py
+++ b/web.py
@@ -16,18 +16,24 @@ class Grab(urllib.URLopener):
urllib._urlopener = Grab()
def get(uri):
+ if not uri.startswith('http'):
+ return
u = urllib.urlopen(uri)
bytes = u.read()
u.close()
return bytes
def head(uri):
+ if not uri.startswith('http'):
+ return
u = urllib.urlopen(uri)
info = u.info()
u.close()
return info
def post(uri, query):
+ if not uri.startswith('http'):
+ return
data = urllib.urlencode(query)
u = urllib.urlopen(uri, data)
bytes = u.read()