예제 #1
0
def poi():
    if limit_request(request.remote_addr):
        return {"message": "Too Many Requests"}, 429

    return queryHelper('''
        SELECT *
        FROM public.poi;
    ''')
예제 #2
0
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;
    ''')
예제 #3
0
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;
    ''')
예제 #4
0
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;
    ''')
예제 #5
0
def index():
    if limit_request(request.remote_addr):
        return jsonify({"message": "Too Many Requests", "status": 429})

    return 'Welcome to EQ Works 😎'