diff --git a/sms_location/README.md b/sms_location/README.md new file mode 100644 index 000000000..9a48b96c6 --- /dev/null +++ b/sms_location/README.md @@ -0,0 +1,21 @@ + +# Sms_Location + +# How to get Dev-Api +- Register your phone no on [Fast2Sms](https://www.fast2sms.com) +- Enter your valid Api-Key in authorization + + ```python + query={"authorization":"your api key ", #copy paste your api-key + "sender_id":"FSTSMS", + "message":msg, + "language":"english", + "route":"p", + "numbers":no + } + ``` +- Run your script and enter the valid mobile no at which you wanted to send your location + +# Screen-shots + +![Screenshot_2020-10-13-14-04-27-100_com android mms](https://user-images.githubusercontent.com/42912055/95842393-1ed37f80-0d64-11eb-86bb-998144966ff5.jpg) \ No newline at end of file diff --git a/sms_location/requirements.txt b/sms_location/requirements.txt new file mode 100644 index 000000000..c65ee24a9 --- /dev/null +++ b/sms_location/requirements.txt @@ -0,0 +1,6 @@ +certifi==2020.6.20 +chardet==3.0.4 +idna==2.10 +jason==0.1.7 +requests==2.24.0 +urllib3==1.25.10 \ No newline at end of file diff --git a/sms_location/sms_loc.py b/sms_location/sms_loc.py new file mode 100644 index 000000000..156afb459 --- /dev/null +++ b/sms_location/sms_loc.py @@ -0,0 +1,23 @@ +import requests +no = input("enter your no") +r = requests.get('https://get.geojs.io/') +ip_request = requests.get('https://get.geojs.io/v1/ip.json') +ipadd = ip_request.json()['ip'] +url = 'https://get.geojs.io/v1/ip/geo/' + ipadd + '.json' +geo_request = requests.get(url) +geo_data = geo_request.json() +msg = f"latitude: {geo_data['latitude']} longitude : {geo_data['longitude']} city : {geo_data['city']}" +url1 = "https://www.fast2sms.com/dev/bulk" +query = {"authorization" : "your api key ", + "sender_id" : "FSTSMS", + "message" : msg, + "language" : "english", + "route" : "p", + "numbers" : no + } + +headers = { + 'cache-control' : "no-cache" +} +response = requests.request("GET", url1, headers=headers, params=query) +print(response.text)