Karlsen commited on
Commit
a1d8aa7
1 Parent(s): 3318238

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,7 +4,10 @@ import requests
4
  # Function to get latitude and longitude from a place name using Nominatim
5
  def get_lat_lon(place_name):
6
  url = f"https://nominatim.openstreetmap.org/search?q={place_name}&format=json&limit=1"
7
- response = requests.get(url)
 
 
 
8
  if response.status_code == 200:
9
  results = response.json()
10
  if results:
 
4
  # Function to get latitude and longitude from a place name using Nominatim
5
  def get_lat_lon(place_name):
6
  url = f"https://nominatim.openstreetmap.org/search?q={place_name}&format=json&limit=1"
7
+ headers = {
8
+ 'User-Agent': 'YourAppName/1.0 (your_email@example.com)'
9
+ }
10
+ response = requests.get(url, headers=headers)
11
  if response.status_code == 200:
12
  results = response.json()
13
  if results: