interverse/server/interverse-proxy.py

20 lines
525 B
Python
Raw Normal View History

from flask import Flask,request,redirect
import json,requests,time
import simple_cache
app = Flask('interverse-proxy')
cache = simple_cache.Cache()
@app.route("/", methods=['GET'])
def interverse_proxy():
url = request.args.get('url')
if url == None:
return redirect("https://codeberg.org/gabe/Interverse",307)
return "See <a href='https://codeberg.org/gabe/Interverse'>Interverse</a>"
2022-10-10 04:22:04 -04:00
data = cache.get_interverse_data(url)
return json.dumps(data)
if __name__ == '__main__':
app.run()