fw1zr commited on
Commit
6244f65
1 Parent(s): ab62813

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. webapp.py +17 -11
webapp.py CHANGED
@@ -1,19 +1,25 @@
1
  import gradio as gr
2
  from utils import get_comments, get_users_from_keyword
3
 
4
- iface1 = gr.Interface(fn=get_comments,
5
- inputs=gr.Textbox(label="Instagram Post URL"),
6
- outputs=gr.Dataframe(),
7
- title="Instagram Comments Extractor",
8
- description="Enter an Instagram post URL to extract and display comments.")
 
9
 
10
 
11
- iface2 = gr.Interface(fn=get_users_from_keyword,
12
- inputs=gr.Textbox(label="Search keyword"),
13
- outputs=gr.Dataframe(),
14
- title="Instagram User keyword search",
15
- description="Enter an keyword to search for users.")
 
16
 
17
- demo = gr.TabbedInterface([iface1, iface2], ["Instagram comment extractor", "Instagram user keyword search"])
 
 
 
 
18
 
19
  demo.launch(share=True)
 
1
  import gradio as gr
2
  from utils import get_comments, get_users_from_keyword
3
 
4
+ with gr.Blocks() as iface1:
5
+ with gr.Row():
6
+ input_url =gr.Textbox(label="Instagram URL")
7
+ search = gr.Button("Search")
8
+ output_component = gr.Dataframe(headers=['username','comment_text','user_is_verfied','user_is_private', 'commment_like_count'])
9
+ search.click(fn=get_comments, inputs=input_url, outputs=output_component,api_name="search_function")
10
 
11
 
12
+ with gr.Blocks() as iface2:
13
+ with gr.Row():
14
+ input_url =gr.Textbox(label="Keyword")
15
+ search = gr.Button("Search")
16
+ output_component = gr.Dataframe(headers=['username','is_verified'])
17
+ search.click(fn=get_users_from_keyword, inputs=input_url, outputs=output_component,api_name="search_function")
18
 
19
+
20
+
21
+ demo = gr.TabbedInterface([iface1, iface2], [
22
+ "Instagram comment extractor", "Instagram user keyword search"],
23
+ title = "Instagram scraping tool")
24
 
25
  demo.launch(share=True)