Spaces:
Runtime error
Runtime error
Commit History
-
Update app.py
Verified signature5272ca4 -
Update app.py
Verified signature40d0b84 -
Update app.py
Verified signatureimport requests import gradio as gr # Pexels API 키를 여기에 입력하세요 API_KEY = '' IMAGE_API_URL = 'https://api.pexels.com/v1/search' VIDEO_API_URL = 'https://api.pexels.com/videos/search' def search_images(keyword): headers = {'Authorization': API_KEY} params = {'query': keyword, 'per_page': 8} response = requests.get(IMAGE_API_URL, headers=headers, params=params) if response.status_code == 200 and response.json()['photos']: photos = response.json()['photos'] result_html = "" for photo in photos: image_url = photo['src']['original'] photographer = photo['photographer'] photographer_url = photo['photographer_url'] photo_url = photo['url'] result_html += f""" <div style='margin-bottom: 20px;'> <img src='{image_url}' width='100%' /> <p>This <a href='{photo_url}'>Photo</a> was taken by <a href='{photographer_url}'>{photographer}</a> on…b36bb3c -
Update app.py
Verified signature9f84ced -
Update app.py
Verified signature36bbe72 -
Create requirements.txt
Verified signature1b2fce6 -
Rename apy.py to app.py
Verified signature36a2859 -
Create apy.py
Verified signature6e755a1 -
initial commit
Verified signature3c259bb