|
import requests |
|
|
|
|
|
def find(input_str): |
|
if len(input_str) < 4: |
|
return ["4๊ธ์ ์ด์์ผ๋ก ์์ฑํด์ฃผ์ธ์."] |
|
|
|
base_url = "https://cache.nova.gd/user/v1" |
|
|
|
url = f"{base_url}/search?query={input_str}" |
|
response = requests.get(url) |
|
data = response.json() |
|
users = data.get("results", []) |
|
|
|
if response.status_code != 200: |
|
raise Exception(f"Request failed with status code {response.status_code}") |
|
|
|
if not users: |
|
return ["๊ฒ์ ๊ฒฐ๊ณผ ์์"] |
|
|
|
|
|
result_list = [user['nickname'] for user in users[:25]] |
|
return result_list |
|
|
|
|
|
def adress_search(input_str): |
|
if len(input_str) < 4: |
|
return "4๊ธ์ ์ด์์ผ๋ก ์์ฑํด์ฃผ์ธ์." |
|
|
|
base_url = "https://cache.nova.gd/user/v1" |
|
|
|
url = f"{base_url}/search?query={input_str}" |
|
response = requests.get(url) |
|
data = response.json() |
|
|
|
|
|
address = data['results'][0]['address'] |
|
address = str(address) |
|
return address |