Exemplo n.º 1
0
def post_event_api(client_id,user_id = None):
    host = params.host
    for event in params.event_list:
        if event == 'ad_click':
            if random.randint(1,100) < 90:
                print('ad_click pass')
                continue
        url          = host + params.apis['event']
        common_param = params.common_param(client_id,user_id)
        func         = event + "_param"
        res          = runpy.run_module('params',run_name=func )
        event_param  = res[func]()
        send(url,common_param,event_param)
Exemplo n.º 2
0
def post_error_api(client_id,user_id = None):
    url          = params.host + params.apis['error']
    common_param = params.common_param(client_id,user_id)
    data_param   = params.api_error_param()
    send(url,common_param,data_param)