def poi(): if limit_request(request.remote_addr): return {"message": "Too Many Requests"}, 429 return queryHelper(''' SELECT * FROM public.poi; ''')
def stats_hourly(): if limit_request(request.remote_addr): return jsonify({"message": "Too Many Requests", "status": 429}) return queryHelper(''' SELECT date, hour, impressions, clicks, revenue FROM public.hourly_stats ORDER BY date, hour LIMIT 168; ''')
def events_daily(): if limit_request(request.remote_addr): return jsonify({"message": "Too Many Requests", "status": 429}) return queryHelper(''' SELECT date, SUM(events) AS events FROM public.hourly_events GROUP BY date ORDER BY date LIMIT 7; ''')
def stats_daily(): if limit_request(request.remote_addr): return jsonify({"message": "Too Many Requests", "status": 429}) return queryHelper(''' SELECT date, SUM(impressions) AS impressions, SUM(clicks) AS clicks, SUM(revenue) AS revenue FROM public.hourly_stats GROUP BY date ORDER BY date LIMIT 7; ''')
def index(): if limit_request(request.remote_addr): return jsonify({"message": "Too Many Requests", "status": 429}) return 'Welcome to EQ Works 😎'