ZoomQuiet avatar ZoomQuiet committed 9db38cb

up 4 GAE

Comments (0)

Files changed (1)

 import traceback
 from hashlib import md5
 from bottle import *
 #import urllib2 as urilib
-from google.appengine.api import urlfetch 
+from google.appengine.api import urlfetch
 from google.appengine.ext.webapp.util import run_wsgi_app
 #from django.utils import simplejson
 cfg = Borg()
 def error404(error):
     return '404 !-( Nothing here, sorry'
 def index():
     return dict(name="urisaok"
-        ,version="{v12.02.29}"
-        ,decc="Bottle @ SAE 4 KCS"
+        ,version="{v12.03.1+1"
+        ,desc="Bottle @ SAE 4 KCS"
         ,usage="curl --data 'uri=http://sina.cn' http://urisaok.appsp0t.com/chk"
 #@route('/chk:uri', method='GET')
+@route('/chk/', method="POST")
 @route('/chk', method="POST")
 def chk():
     uri = request.forms.get('uri')
     api_url = "http://%s/%s/"% (cfg.OPEN_HOST, api_path) + "?" + "&".join(key_values)
     #print api_url
     result = urlfetch.fetch(api_url)
-    if result.status_code == 200:  
+    if result.status_code == 200:
         doc = result.content
-        #print doc
+        print doc
     return doc
 def __genQueryArgs(api_path, url):
     args["sign"] = md5(sign_base_string + cfg.SECRET).hexdigest()
     #print args, sign_base_string
     return args
 def __genSignString(api_path, args):
     keys = args.keys()
 def main():
     '''Remove this when on production '''
-    app = default_app()    
+    app = default_app()
 if __name__ == '__main__':
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.