tracked JSON view

This commit is contained in:
James Turk 2011-08-02 14:04:41 -04:00
parent 482a0ea1ae
commit 96ccea0f1e

View File

@ -36,6 +36,11 @@ def log_view():
return flask.render_template('logs.html', logs=logs) return flask.render_template('logs.html', logs=logs)
@app.route('/tracked/')
def tracked():
tracked = list(client.db.tracked.find())
return json.dumps(tracked, cls=JSONEncoder)
@app.route('/tracked/<path:url>') @app.route('/tracked/<path:url>')
def tracked_view(url): def tracked_view(url):
doc = client.db.tracked.find_one({'url': url}) doc = client.db.tracked.find_one({'url': url})