Ejemplo n.º 1
0
    #Regex格式驗證
    import re
    text_re = re.compile('Text=')
    queryString = PhoneNumberurl.split("&")
    for param in queryString:
        if len(text_re.findall(param)) > 0:
            return param[5:]


if __name__ == '__main__':
    jsondata = ""
    try:
        JobID = sys.argv[1]
        data = sys.argv[2]

        jsondata = PublicFun.StringToJson(data)
        jobdate = str(jsondata["date"])
        jobName = PublicFun.SQLFilter(str(jsondata["jobName"]))
        jobURL = str(jsondata["jobURL"])
        jobAREA = str(jsondata["jobAREA"])
        companyInfo = jsondata["companyInfo"]
        try:
            companyName = PublicFun.SQLFilter(str(companyInfo["companyName"]))
        except Exception as ex:
            companyInfo = PublicFun.StringToJson(companyInfo, Default=False)
            companyName = PublicFun.SQLFilter(str(companyInfo["companyName"]))
        ScanDate = str(jsondata["ScanDate"])

        DBConnect = SQLConnect.DBConnect(publicSetting=True)
        DBConnect.ConnectDB()
Ejemplo n.º 2
0
def getPhoneNumber(PhoneNumberurl):
    #Regex格式驗證
    import re
    text_re = re.compile('Text=')
    queryString = PhoneNumberurl.split("&")
    for param in queryString:
        if len(text_re.findall(param)) > 0:
            return param[5:]


if __name__ == '__main__':
    jsondata = ""
    try:
        JobID = sys.argv[1]
        data = sys.argv[2]
        jsondata = PublicFun.StringToJson(data)
        companyURL = str(jsondata["companyURL"])
        companyName = str(jsondata["companyName"])

        DBConnect = SQLConnect.DBConnect(publicSetting=True)
        DBConnect.ConnectDB()

        CompanyGUID = BIASDataIO.CheckCompanyMappingList(
            DBConnect, companyName)
        companyInFo = Engine.Query(DBConnect, Companys.Companys(),
                                   "GUID='" + CompanyGUID + "'")

        if companyInFo.GUID == "":
            companyInFo.GUID = CompanyGUID
            companyInFo.D_INSERTUSER = "******"
        else: