acm-proxy

acm library proxy
git clone https://git.parazyd.org/acm-proxy
Log | Files | Refs | README

proxy.py (460B)


      1 #!/usr/bin/env python3
      2 
      3 from flask import Flask, render_template
      4 from subprocess import check_output
      5 
      6 app = Flask(__name__)
      7 
      8 def get_page(page):
      9     return check_output(["node", "scrape.js", 'https://dl.acm.org/' + page])
     10 
     11 @app.route('/<path:dummy>')
     12 def index(dummy):
     13     return get_page(dummy)
     14 
     15 @app.route('/')
     16 def main():
     17     return get_page('https://dl.acm.org/loi/csur')
     18 
     19 
     20 if __name__ == '__main__':
     21     app.run(host='127.0.0.1', port='8091', debug=True)