Example #1
0
    def ads_clicked(cls, rparams):
        TyContext.ftlog.debug('AdsLimei.ads_clicked rparams:', rparams)

        try:
            appId = int(rparams['appId'])
        except:
            appId = 0
        try:
            idfa = rparams['udid']
            if not is_valid_idfa(idfa):
                idfa = ''
        except:
            idfa = ''
        try:
            mac = rparams['udid']
        except:
            mac = ''
        macmd5 = ''
        if is_valid_macmd5(mac):
            macmd5 = mac
            mac = ''
        elif not is_valid_mac(mac):
            mac = ''

        ids = {}
        ids['iosappid'] = appId
        ids['mac'] = mac.lower()
        ids['macmd5'] = macmd5.lower()
        ids['idfa'] = idfa.lower()
        note = '{"pburl":"' + rparams['pburl'] + '"}'
        AdvertiseService.record_click(ids, rparams['clkip'], cls.get_spname(),
                                      note)

        return 'success'
Example #2
0
    def ads_clicked(cls, rparams):
        TyContext.ftlog.debug('AdsShike.ads_clicked rparams:', rparams)
        try:
            appId = int(rparams['appid'])
        except:
            appId = 0
        try:
            idfa = rparams['idfa']
            if not is_valid_idfa(idfa):
                idfa = ''
        except:
            idfa = ''
        try:
            ip = rparams['ip']
        except:
            ip = rparams['clkip']
        try:
            mac = rparams['mac']
        except:
            mac = ''
        macmd5 = ''
        if is_valid_macmd5(mac):
            macmd5 = mac
            mac = ''
        elif not is_valid_mac(mac):
            mac = ''

        ids = {}
        ids['iosappid'] = appId
        ids['mac'] = mac.lower()
        ids['macmd5'] = macmd5.lower()
        ids['idfa'] = idfa.lower()
        if 'callback' in rparams and rparams['callback'] != '':
            note = '{"callback_url":"' + rparams['callback'] + '"}'
            AdvertiseService.record_click(ids, ip, cls.get_spname(), note)
        else:
            AdvertiseService.record_click(ids, ip, cls.get_spname())

        return 200
Example #3
0
    def ads_clicked(cls, rparams):
        TyContext.ftlog.debug('AdsChukong.ads_clicked rparams:', rparams)
        try:
            idfa = rparams['idfa']
            if not is_valid_idfa(idfa):
                idfa = ''
        except:
            idfa = ''
        try:
            mac = rparams['mac']
        except:
            mac = ''
        try:
            appId = int(rparams['appId'])
        except:
            appId = 0
        macmd5 = ''
        if is_valid_macmd5(mac):
            macmd5 = mac
            mac = ''
        elif not is_valid_mac(mac):
            mac = ''
        if 'callback' not in rparams:
            rparams[
                'callback'] = 'http://stats.cocounion.com/event/chukong/546bfa980efa549b77000011'

        ids = {}
        ids['iosappid'] = appId
        ids['mac'] = mac.lower()
        ids['macmd5'] = macmd5.lower()
        ids['idfa'] = idfa.lower()
        note = '{"os":"' + rparams['os'] + '","callback":"' + rparams[
            'callback'] + '"}'
        AdvertiseService.record_click(ids, rparams['clkip'], cls.get_spname(),
                                      note)

        return 'success'
Example #4
0
    def ads_clicked(cls, rparams):
        TyContext.ftlog.debug('AdsDuomeng.ads_clicked rparams:', rparams)
        try:
            idfa = rparams['ifa']
            if not is_valid_idfa(idfa):
                idfa = ''
        except:
            idfa = ''
        try:
            mac = rparams['mac']
        except:
            mac = ''
        try:
            appId = int(rparams['appId'])
        except:
            appId = 0
        macmd5 = ''
        if is_valid_macmd5(mac):
            macmd5 = mac
            mac = ''
        elif not is_valid_mac(mac):
            mac = ''

        ids = {}
        ids['iosappid'] = appId
        ids['mac'] = mac.lower()
        ids['macmd5'] = macmd5.lower()
        ids['idfa'] = idfa.lower()
        AdvertiseService.record_click(ids, rparams['clkip'], cls.get_spname())

        httpreq = TyContext.RunHttp.get_request()
        red_addr = cls.__get_redirect_address(appId)
        httpreq.redirect(red_addr)
        httpreq.finish()
        # hack: return 'redirected' so that execHtml will not handle the request
        return 'redirected'