|
import gradio as gr |
|
import requests |
|
|
|
def send_webhook(email): |
|
webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjYwNTZmMDYzMDA0M2M1MjZiNTUzMzUxMzUi_pc" |
|
payload = {"email": email} |
|
|
|
try: |
|
response = requests.post(webhook_url, json=payload) |
|
return f"์๋ต ์ฝ๋: {response.status_code}\n์๋ต ๋ด์ฉ: {response.text}" |
|
except Exception as e: |
|
return f"์๋ฌ ๋ฐ์: {str(e)}" |
|
|
|
|
|
demo = gr.Interface( |
|
fn=send_webhook, |
|
inputs=gr.Textbox(label="์ด๋ฉ์ผ ์ฃผ์", placeholder="์ด๋ฉ์ผ์ ์
๋ ฅํ์ธ์"), |
|
outputs=gr.Textbox(label="๊ฒฐ๊ณผ"), |
|
title="์ด๋ฉ์ผ ์นํ
์ ์ก", |
|
description="์
๋ ฅํ ์ด๋ฉ์ผ ์ฃผ์๋ฅผ ์นํ
์ผ๋ก ์ ์กํฉ๋๋ค.", |
|
live=False |
|
) |
|
|
|
|
|
if __name__ == "__main__": |
|
demo.queue().launch(share=False, server_port=7860) |