-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSendMessage.py
More file actions
31 lines (27 loc) · 768 Bytes
/
Copy pathSendMessage.py
File metadata and controls
31 lines (27 loc) · 768 Bytes
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
#
#Author Kayas Ahmed
#
import socket
import sys
from twilio.rest import TwilioRestClient
import pyowm
import time
# Create a UDS socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
server_address = 'echo_socket'
print >>sys.stderr, 'connecting to %s' % server_address
try:
sock.connect(server_address)
except socket.error, msg:
print >>sys.stderr, msg
sys.exit(1)
while True:
data = sock.recv(16)
owm=pyowm.OWM('xxxxxxxx')
acc_sid="xxxxxxxx"
auth_token="xxxxxxxxx"
client=TwilioRestClient(acc_sid,auth_token);
message=client.messages.create(body="Weather in Bangalore is Humidity is "+str(humidity),to="+917204352825",from_="+1916740-1388")
# print message.sid
break