Skip to content

Commit 1331a38

Browse files
authored
Merge pull request #269 from bunnysworld/smsloc
added script for sms_loc
2 parents d0a70fa + 8fcbdf8 commit 1331a38

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

sms_location/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# Sms_Location
3+
4+
# How to get Dev-Api
5+
- Register your phone no on [Fast2Sms](https://www.fast2sms.com)
6+
- Enter your valid Api-Key in authorization
7+
8+
```python
9+
query={"authorization":"your api key ", #copy paste your api-key
10+
"sender_id":"FSTSMS",
11+
"message":msg,
12+
"language":"english",
13+
"route":"p",
14+
"numbers":no
15+
}
16+
```
17+
- Run your script and enter the valid mobile no at which you wanted to send your location
18+
19+
# Screen-shots
20+
21+
![Screenshot_2020-10-13-14-04-27-100_com android mms](https://user-images.githubusercontent.com/42912055/95842393-1ed37f80-0d64-11eb-86bb-998144966ff5.jpg)

sms_location/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
certifi==2020.6.20
2+
chardet==3.0.4
3+
idna==2.10
4+
jason==0.1.7
5+
requests==2.24.0
6+
urllib3==1.25.10

sms_location/sms_loc.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import requests
2+
no = input("enter your no")
3+
r = requests.get('https://get.geojs.io/')
4+
ip_request = requests.get('https://get.geojs.io/v1/ip.json')
5+
ipadd = ip_request.json()['ip']
6+
url = 'https://get.geojs.io/v1/ip/geo/' + ipadd + '.json'
7+
geo_request = requests.get(url)
8+
geo_data = geo_request.json()
9+
msg = f"latitude: {geo_data['latitude']} longitude : {geo_data['longitude']} city : {geo_data['city']}"
10+
url1 = "https://www.fast2sms.com/dev/bulk"
11+
query = {"authorization" : "your api key ",
12+
"sender_id" : "FSTSMS",
13+
"message" : msg,
14+
"language" : "english",
15+
"route" : "p",
16+
"numbers" : no
17+
}
18+
19+
headers = {
20+
'cache-control' : "no-cache"
21+
}
22+
response = requests.request("GET", url1, headers=headers, params=query)
23+
print(response.text)

0 commit comments

Comments
 (0)