add ua to contact list

This commit is contained in:
2024-06-17 20:26:27 +02:00
parent c5ed9d0834
commit 9daac6954b
3 changed files with 15 additions and 5 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ from src.utils.excel_reader import read_contacts, fr_phone_number_prefix, get_ra
def upload_contacts_list():
_contacts_to_book = read_contacts("/Users/lpan/Desktop/contact_list_2024-05-16.xlsx")
_contacts_to_book = read_contacts("/Users/lpan/Desktop/contact_list_2024-06-17.xlsx")
return _contacts_to_book
@@ -143,10 +143,10 @@ if __name__ == '__main__':
# contacts_to_book = upload_contacts_list()
# MONGO_STORE_MANAGER.upload_contact_list(contacts_to_book)
# 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/panlei/Downloads/邮箱及密码.xlsx")
# print("end at {}".format(datetime.datetime.now()))
# generate_all_contact_list()
generate_all_contact_list()
# merge_contact_list_files(
# ["/Users/lpan/Desktop/contact_list_2024-05-07.xlsx",
# "/Users/lpan/Desktop/contact_list_2024-05-06.xlsx",
+6 -1
View File
@@ -44,7 +44,8 @@ class ContactPojo:
u'first_name': self.first_name,
u'mail': self.mail,
u'store': self.store,
u'ip_country': self.ip_country
u'ip_country': self.ip_country,
u'ua': self.ua
}
return dest
@@ -67,7 +68,11 @@ class ContactPojo:
ip_country = "FR"
if source.get('ip_country'):
ip_country = source['ip_country']
ua = ""
if source.get('ua'):
ua = source['ua']
result = ContactPojo(phone_number=phone, passport_number=passport, mail=email,
last_name=last_name, first_name=first_name, store=store)
result.ip_country = ip_country
result.ua = ua
return result
+5
View File
@@ -48,6 +48,10 @@ def read_contacts(file_name) -> list:
store = "random"
if contact_dict.get('store') is not None:
store = contact_dict['store']
ua = ""
if contact_dict.get('ua') is not None:
ua = contact_dict['ua']
contact = ContactPojo(phone_number=contact_dict['phone'],
last_name=last_name,
@@ -55,6 +59,7 @@ def read_contacts(file_name) -> list:
passport_number=contact_dict['passport'],
mail=contact_dict['email'], store=store)
contact.ip_country = ip_country
contact.ua = ua
contact_list.append(contact)
return contact_list