-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbulk_msg.py
57 lines (48 loc) · 1.27 KB
/
bulk_msg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import pywhatkit
import datetime
import time
import csv
# Date in datetime
now = datetime.datetime.now()
# Date in integer
year = int(now.strftime('%Y'))
month = int(now.strftime('%m'))
day = int(now.strftime('%d'))
hour = int(now.strftime('%H'))
minute = int(now.strftime('%M'))
second = int(now.strftime('%S'))
# Print date in string
print("")
print(str(year)+'/'+str(month)+'/'+str(day)+' at '+str(hour)+':'+str(minute)+':'+str(second))
time.sleep(5)
# Counter
count = 0
# Select image
img = "images/jetmarket3/main.jpg"
# Type your message
msg = """Dear Mattia,
i'm using your script csv import.
Thank you!
bye!"""
# Send Message with Caption
with open('contacts/contacts.csv') as csvfile:
contactList = csv.reader(csvfile)
print(" ")
for num in contactList:
if minute < 59:
minute=minute+1
if min == 59:
min == 0
hour=hour+1
cellphone = "+" + str(num[0])
print(cellphone)
pywhatkit.sendwhats_image(cellphone, img , msg)
count = count +1
print(str(count) + '° operation done '+ cellphone + ' at ' + str(hour) + ':' + str(minute))
print(" ")
time.sleep(5)
print(" ")
print(" ")
print(str(count)+" messages sent, operation complete succesfully")
print(" ")
print(" ")