예제 #1
0
def __reportmh(url):
    '''获取数据魔盒处理对象'''
    report_data = {}
    try:
        all_url = url.replace(".json", "_all.json")
        start = time.clock()
        json_data = getReportByUrl(all_url)
        report_json_data = getReportByUrl(url)
        end = time.clock()
        logger.info("拉取魔盒报告时间耗时:%s" % str(end - start))
        start = time.clock()
        oReport = Reportmh(json_data, report_json_data)
        report_data = oReport.run()
        end = time.clock()
        logger.info("分析魔盒报告时间耗时:%s" % str(end - start))
    except Exception as e:
        logger.error("url:%s mh report is fail: %s" % (all_url, e))
    return report_data
예제 #2
0
def __reportbr(url):
    '''获取百融处理对象'''
    report_data = {}
    try:
        json_data = getReportByUrl(url)
        oReport = Reportbr(json_data)
        report_data = oReport.run()
    except Exception as e:
        logger.error("url:%s br report is fail: %s" % (url, e))
    return report_data
예제 #3
0
 def __getJsonDataByUrl(self, url):
     if url is None:
         return None
     try:
         data = getReportByUrl(url)
         # logger.error(json.dumps(data))
     except Exception as e:
         logger.info("json数据获取失败: %s" % e)
         return None
     return data
예제 #4
0
 def __analysis_detail(self, detail_url):
     detail_data = {}
     detail_other_data = {}
     try:
         json_data = getReportByUrl(detail_url)
         if json_data:
             self.oDetail = Detail(json_data)
             detail_data, detail_other_data = self.oDetail.run()
     except Exception as e:
         logger.error("detail_url:%s detail is fail: %s" % (detail_url, e))
     return detail_data, detail_other_data
예제 #5
0
def __reportss(url):
    '''获取上数处理对象'''
    report_data = {}
    try:
        start = time.clock()
        json_data = getReportByUrl(url)
        end = time.clock()
        logger.info("拉取上树报告时间耗时:%s" % str(end - start))
        start = time.clock()
        oReport = Reportss(json_data)
        report_data = oReport.run()
        end = time.clock()
        logger.info("分析上树报告时间耗时:%s" % str(end - start))
    except Exception as e:
        logger.error("url:%s ss report is fail: %s" % (url, e))
    return report_data
예제 #6
0
def analysis_detail(detail_url, contact):
    detail_data = {}
    detail_other_data = {}
    detail_vscontact = {}
    try:
        json_data = getReportByUrl(detail_url)
        if json_data:
            detail_phone = json_data
            oDetail = Detail(json_data)
            detail_data, detail_other_data = oDetail.run()
            if contact is not None:
                dict_contact = {}
                dict_contact['phone'] = contact.phone
                dict_contact['mobile'] = contact.mobile
            detail_vscontact = oDetail.vsContact(dict_contact)
    except Exception as e:
        logger.error("detail_url:%s detail is fail: %s" % (detail_url, e))
    return detail_data, detail_vscontact