2022-10-09 11:48:31 -04:00
|
|
|
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)
|
2022-10-09 11:48:31 -04:00
|
|
|
return json.dumps(data)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
app.run()
|