mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-12-18 00:00:14 +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)
|