change phonenumber prefix
This commit is contained in:
@@ -18,7 +18,7 @@ DEFAULT_SERIAL_TO_IGNORE = ["47e7e36b", "bitbrowser"]
|
|||||||
|
|
||||||
|
|
||||||
def upload_contacts_list():
|
def upload_contacts_list():
|
||||||
_contacts_to_book = read_contacts(str(Path.home()) + "/Desktop/contact_list_2025-03-08_aol_400.xlsx")
|
_contacts_to_book = read_contacts(str(Path.home()) + "/Desktop/extracted_aol_contacts_292_24_03_mac.xlsx")
|
||||||
return _contacts_to_book
|
return _contacts_to_book
|
||||||
|
|
||||||
|
|
||||||
@@ -33,10 +33,15 @@ def fix_phone_number_format(file_path):
|
|||||||
_contact.first_name = original_last_name.replace("\xa0", " ").split(" ")[1]
|
_contact.first_name = original_last_name.replace("\xa0", " ").split(" ")[1]
|
||||||
print(_contact)
|
print(_contact)
|
||||||
if _contact.phone.startswith('7'):
|
if _contact.phone.startswith('7'):
|
||||||
if _contact.phone[0:2] not in fr_phone_number_prefix:
|
_need_to_fix = True
|
||||||
|
for prefix in fr_phone_number_prefix:
|
||||||
|
if _contact.phone.startswith(prefix):
|
||||||
|
_need_to_fix = False
|
||||||
|
# if _contact.phone[0:2] not in fr_phone_number_prefix:
|
||||||
|
if _need_to_fix:
|
||||||
print(_contact)
|
print(_contact)
|
||||||
_contact.phone = get_random_fr_phone_numbers()
|
_contact.phone = get_random_fr_phone_numbers()
|
||||||
write_new_contacts_to_excel(_contact_list, file_name="15_05_to_test")
|
write_new_contacts_to_excel(_contact_list, file_name="real_name_contacts_500_27_03_25_fixed")
|
||||||
|
|
||||||
|
|
||||||
def generate_contact_from_mail_list(mail_list_file,
|
def generate_contact_from_mail_list(mail_list_file,
|
||||||
@@ -94,7 +99,7 @@ def write_new_contacts_to_excel(valid_contacts: list, file_name=str(datetime.dat
|
|||||||
|
|
||||||
|
|
||||||
def generate_valid_contact_list_for_day(segment_number=1):
|
def generate_valid_contact_list_for_day(segment_number=1):
|
||||||
_collection_name = "2025-03-12"
|
_collection_name = "2025-03-14"
|
||||||
_valid_contact_list = MONGO_STORE_MANAGER.get_all_successful_items_for_one_day(_collection_name)
|
_valid_contact_list = MONGO_STORE_MANAGER.get_all_successful_items_for_one_day(_collection_name)
|
||||||
_all_contacts = MONGO_STORE_MANAGER.get_all_contacts_to_book()
|
_all_contacts = MONGO_STORE_MANAGER.get_all_contacts_to_book()
|
||||||
_contact_to_save = []
|
_contact_to_save = []
|
||||||
@@ -243,13 +248,13 @@ def write_resident_card_number_to_contact_list(file_to_read, file_name="contact_
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# write_resident_card_number_to_contact_list(file_to_read=str(Path.home()) + "/Desktop/contact_list_all_12.xlsx",
|
# write_resident_card_number_to_contact_list(file_to_read=str(Path.home()) + "/Desktop/contact_list_all_13.xlsx",
|
||||||
# file_name="contact_list_all_12")
|
# file_name="contact_list_all_13")
|
||||||
# contacts_to_book = upload_contacts_list()
|
# contacts_to_book = upload_contacts_list()
|
||||||
# MONGO_STORE_MANAGER.upload_contact_list(contacts_to_book)
|
# MONGO_STORE_MANAGER.upload_contact_list(contacts_to_book)
|
||||||
# print("start at {}".format(datetime.datetime.now()))
|
# print("start at {}".format(datetime.datetime.now()))
|
||||||
generate_valid_contact_list_for_day(segment_number=2)
|
# generate_valid_contact_list_for_day(segment_number=2)
|
||||||
# generate_contact_from_mail_list("/Users/lpan/Downloads/邮箱及密码_aol_400_08_03_2025.xlsx")
|
# generate_contact_from_mail_list("/Users/lpan/Downloads/邮箱及密码_23_03_25_yahoo.xlsx")
|
||||||
# print("end at {}".format(datetime.datetime.now()))
|
# print("end at {}".format(datetime.datetime.now()))
|
||||||
# update_contact_list_not_received_mail()
|
# update_contact_list_not_received_mail()
|
||||||
# get_old_validated_contact_list()
|
# get_old_validated_contact_list()
|
||||||
@@ -261,4 +266,4 @@ if __name__ == '__main__':
|
|||||||
# "/Users/lpan/Desktop/contact_list_2024-11-08.xlsx",
|
# "/Users/lpan/Desktop/contact_list_2024-11-08.xlsx",
|
||||||
# "/Users/lpan/Desktop/contact_list_2024-11-06.xlsx"
|
# "/Users/lpan/Desktop/contact_list_2024-11-06.xlsx"
|
||||||
# ])
|
# ])
|
||||||
# fix_phone_number_format("/Users/lpan/Desktop/15_05_to_test.xlsx")
|
fix_phone_number_format(str(Path.home()) + "/Desktop/real_name_contacts_500_27_03_25.xlsx")
|
||||||
|
|||||||
@@ -11,7 +11,16 @@ from src.pojo.contact_pojo import ContactPojo
|
|||||||
from src.pojo.mail.mail_pojo import MailAddress
|
from src.pojo.mail.mail_pojo import MailAddress
|
||||||
from src.utils.contacts.generate_random_passport_id import get_random_passport_id_number
|
from src.utils.contacts.generate_random_passport_id import get_random_passport_id_number
|
||||||
|
|
||||||
fr_phone_number_prefix = ['73', '74', '75', '76', '77', '78', '79']
|
fr_phone_number_prefix = ['75',
|
||||||
|
'76',
|
||||||
|
'770',
|
||||||
|
'771',
|
||||||
|
'772',
|
||||||
|
'775',
|
||||||
|
'777',
|
||||||
|
'778',
|
||||||
|
'779',
|
||||||
|
'78']
|
||||||
chinnese_number_prefix = ['13', '15', '18']
|
chinnese_number_prefix = ['13', '15', '18']
|
||||||
|
|
||||||
|
|
||||||
@@ -193,7 +202,7 @@ def get_random_id_number() -> str:
|
|||||||
|
|
||||||
def save_mails_to_db():
|
def save_mails_to_db():
|
||||||
excel_reader = ExcelHelper()
|
excel_reader = ExcelHelper()
|
||||||
emails = excel_reader.read_email_pojo("~/Downloads/邮箱及密码.xlsx")
|
emails = excel_reader.read_email_pojo("~/Downloads/邮箱及密码_26_03_25_yahoo.xlsx")
|
||||||
print(emails)
|
print(emails)
|
||||||
for mail in emails:
|
for mail in emails:
|
||||||
MONGO_STORE_MANAGER.save_destinary_emails(mail)
|
MONGO_STORE_MANAGER.save_destinary_emails(mail)
|
||||||
@@ -210,5 +219,5 @@ if __name__ == '__main__':
|
|||||||
save_mails_to_db()
|
save_mails_to_db()
|
||||||
# for mail in excel_reader.read_mails_and_pwd():
|
# for mail in excel_reader.read_mails_and_pwd():
|
||||||
# MONGO_STORE_MANAGER.insert_email(mail)
|
# MONGO_STORE_MANAGER.insert_email(mail)
|
||||||
# for i in range(1, 300):
|
for i in range(1, 300):
|
||||||
# print(get_random_fr_phone_numbers())
|
print(get_random_fr_phone_numbers())
|
||||||
|
|||||||
Reference in New Issue
Block a user