Spaces:
Running
Running
Upload 2 files
Browse files- app.py +27 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
import requests
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
def requestAPI(domain):
|
6 |
+
url = f'https://ssl-checker.io/api/v1/check/{domain}'
|
7 |
+
try:
|
8 |
+
response = requests.get(url)
|
9 |
+
except requests.exceptions.RequestException as e:
|
10 |
+
print('Request failed: %s' % e)
|
11 |
+
sys.exit(1)
|
12 |
+
data = response.json()
|
13 |
+
return data
|
14 |
+
|
15 |
+
def app():
|
16 |
+
with gr.Blocks(title="Project Gatekeeper - Get free SSL Certificates") as webui:
|
17 |
+
domains_input = gr.Textbox(label="Enter Domains", placeholder="thenayankasturi.eu.org, dash.thenayankasturi.eu.org, www.thenayankasturi.eu.org", type="text", interactive=True)
|
18 |
+
data = gr.TextArea(label="Data", placeholder="Data will be displayed here", type="text", interactive=False)
|
19 |
+
btn = gr.Button(value="Generate SSL Certificate")
|
20 |
+
btn.click(requestAPI, inputs=domains_input, outputs=data)
|
21 |
+
try:
|
22 |
+
webui.queue(default_concurrency_limit=15).launch()
|
23 |
+
except Exception as e:
|
24 |
+
print(f"Error: {e}")
|
25 |
+
|
26 |
+
if __name__ == "__main__":
|
27 |
+
app()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
requests
|