├── .gitignore ├── README.md ├── aws_lambda_deploy.zip ├── tech_used.jpeg └── whatsapp_messaging.py /.gitignore: -------------------------------------------------------------------------------- 1 | # removing screenshots folder 2 | screenshots/* 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # whatsapp with aws lambda 2 | code for my [blog post](https://medium.com/better-programming/i-wrote-a-script-to-whatsapp-my-parents-every-morning-in-just-20-lines-of-python-code-5d203c3b36c1) on whatsapp messaging using AWS lambda. 3 | 4 | ![Technology stack used](tech_used.jpeg) 5 | -------------------------------------------------------------------------------- /aws_lambda_deploy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kartik-nighania/whatsapp_with_aws_lambda/b5cef59d3bc424088e7a7206b38625782f4c19f1/aws_lambda_deploy.zip -------------------------------------------------------------------------------- /tech_used.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kartik-nighania/whatsapp_with_aws_lambda/b5cef59d3bc424088e7a7206b38625782f4c19f1/tech_used.jpeg -------------------------------------------------------------------------------- /whatsapp_messaging.py: -------------------------------------------------------------------------------- 1 | from twilio.rest import Client 2 | 3 | def msg_mom_and_dad(event=None, context=None): 4 | 5 | # get your sid and auth token from twilio 6 | twilio_sid = 'AC84c9f1602d7fb6af4eda5b0c39a03b37' 7 | auth_token = '4a2021b28f1aa606d9c6945d3c248ebd' 8 | 9 | whatsapp_client = Client(twilio_sid, auth_token) 10 | 11 | # keep adding contacts to this dict to send 12 | # them the message 13 | contact_directory = {'daddy':'+919624666836'} 14 | 15 | for key, value in contact_directory.items(): 16 | msg_loved_ones = whatsapp_client.messages.create( 17 | body = 'good morning {} !'.format(key), 18 | from_= 'whatsapp:+14155238886', 19 | to='whatsapp:' + value, 20 | 21 | ) 22 | 23 | print(msg_loved_ones.sid) --------------------------------------------------------------------------------