예제 #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'
예제 #2
0
    def ads_clicked(cls, rparams):
        TyContext.ftlog.debug('AdsJuzhuanqian.ads_clicked rparams:', rparams)
        try:
            idfa = rparams['idfa']

            if not is_valid_idfa(idfa):
                idfa = ''
        except Exception as e:
            TyContext.ftlog.error('AdsJuzhuanqian.ads_clicked idfa err', e)
            idfa = ''
        try:
            appId = int(rparams['app_id'])
        except Exception as e:
            TyContext.ftlog.error('AdsJuzhuanqian.ads_clicked appId err', e)
            appId = 0
        try:
            appSerect = rparams['app_secret']
        except Exception as e:
            TyContext.ftlog.error('AdsJuzhuanqian.ads_clicked appId err', e)
            appSerect = ''
        if not idfa and not appId and not appSerect:
            return 'fail'
        ids = {}
        ids['iosappid'] = appId
        ids['idfa'] = idfa.lower()
        if 'callback' not in rparams:
            callback = 'http://prd.51remai.cn/api/partner/notify'
        note = '{"callback":"' + callback + '","appSerect":"' + appSerect + '"}'
        AdvertiseService.record_click(ids, rparams['clkip'], cls.get_spname(),
                                      note)
        return 'success'
예제 #3
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
예제 #4
0
파일: adschukong.py 프로젝트: lordsky/hall0
    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'
예제 #5
0
파일: adsduomeng.py 프로젝트: lordsky/hall0
    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'