You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
517 B
Python
22 lines
517 B
Python
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>"
|
|
data = cache.load_data(url)
|
|
return json.dumps(data)
|
|
|
|
if __name__ == '__main__':
|
|
app.run() |