Show prices through a minimal webapp

This commit is contained in:
2022-07-10 23:12:26 +02:00
parent 577ad61cf2
commit b190eebe46
8 changed files with 455 additions and 4 deletions

View File

@@ -1,14 +1,13 @@
#! /usr/bin/env python3
# from bottle import hook, request, route, run, static_file, view
from argparse import ArgumentParser
from config import conf
from datetime import date
from models import Price, IntegrityError
import requests
import json
import webapp
query = """query {
getProductGroups(category: 1, zipcode: 1184) {
@@ -74,6 +73,16 @@ def show(args):
print(get_price())
@subcommand()
def serve(args):
webapp.run(
host=conf["server"].get("host", "localhost"),
port=conf["server"].getint("port", 9980),
debug=conf["server"].getboolean("debug", False),
reloader=conf["server"].getboolean("reloader", False),
)
# ----------------------------------------------------------------------
# Main