mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-24 04:21:08 +00:00
15 lines
458 B
Python
15 lines
458 B
Python
|
import urllib3
|
||
|
import json
|
||
|
http = urllib3.PoolManager()
|
||
|
r = http.request('GET', 'http://ipinfo.io/json')
|
||
|
data = json.loads(r.data.decode('utf-8'))
|
||
|
city=data['city']
|
||
|
loc=data['loc']
|
||
|
print(city,loc)
|
||
|
from twilio.rest import Client
|
||
|
|
||
|
client = Client("TWILO SSID", "AUTH TOKEN")
|
||
|
client.messages.create(to="PHONE NO YOU WANT TO SEND SMS",
|
||
|
from_="YOUR TWILLO PHONE NUMBER",
|
||
|
body="hi amma i am in "+city+" now and my cordinates are " +loc)
|