zanegraper commited on
Commit
ef3a8a7
·
1 Parent(s): d2019da

Updated Program

Browse files
Files changed (3) hide show
  1. app.py +6 -8
  2. emailfinder_wrapper.py +19 -0
  3. requirements.txt +2 -1
app.py CHANGED
@@ -1,13 +1,11 @@
1
  # app.py
2
  import gradio as gr
3
- from email_finder import find_emails
4
 
5
- iface = gr.Interface(
6
- fn=find_emails,
7
  inputs=gr.Textbox(label="Enter a Domain (e.g. example.com)"),
8
  outputs=gr.Textbox(label="Extracted Emails"),
9
- title="Email Finder",
10
- description="An adaptive tool to extract public emails from a website using domain input."
11
- )
12
-
13
- iface.launch()
 
1
  # app.py
2
  import gradio as gr
3
+ from emailfinder_wrapper import run_emailfinder
4
 
5
+ gr.Interface(
6
+ fn=run_emailfinder,
7
  inputs=gr.Textbox(label="Enter a Domain (e.g. example.com)"),
8
  outputs=gr.Textbox(label="Extracted Emails"),
9
+ title="AI-Powered EmailFinder (Search Engine Scraper)",
10
+ description="Uses Google, Bing, Baidu, and Yandex to extract emails associated with a domain."
11
+ ).launch()
 
 
emailfinder_wrapper.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # emailfinder_wrapper.py
2
+ from emailfinder.core import processing
3
+ from io import StringIO
4
+ import sys
5
+
6
+ def run_emailfinder(domain):
7
+ # Redirect stdout temporarily
8
+ old_stdout = sys.stdout
9
+ sys.stdout = mystdout = StringIO()
10
+
11
+ try:
12
+ processing(domain, proxies=None)
13
+ output = mystdout.getvalue()
14
+ except Exception as e:
15
+ output = f"Error: {e}"
16
+
17
+ # Restore stdout
18
+ sys.stdout = old_stdout
19
+ return output
requirements.txt CHANGED
@@ -1,2 +1,3 @@
1
  gradio
2
- requests
 
 
1
  gradio
2
+ requests
3
+ emailfinder