Skip to content

Commit 6c86014

Browse files
authored
KranNaut | Twilio API (#1)
* sms Api addedd * Update sms_query.py
1 parent 88fcf8e commit 6c86014

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

scripts/sms_query.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pymongo
2+
from twilio.rest import Client
3+
from pymongo import MongoClient
4+
5+
account_sid = 'ACa1eb3914142a6680c907b530e0c80fb5'
6+
auth_token = ${{ secrets.TWILIO_KEY }}
7+
client = Client(account_sid, auth_token)
8+
cluster = MongoClient("mongodb+srv://Admin:[email protected]/googlesheetsdb?retryWrites=true&w=majority")
9+
10+
db = cluster["googlesheetsdb"]
11+
collection = db["Area_Codes"]
12+
13+
results = collection.find({"pin":"226012"})
14+
15+
local = []
16+
17+
for result in results:
18+
local.append(result["Number"])
19+
print(local)
20+
21+
for number in local:
22+
number = "+91" + number
23+
message = client.messages.create( from_='+14158492223',body='Where they at tho',to=number)

0 commit comments

Comments
 (0)