File size: 2,151 Bytes
b3ecc7a
98eec6c
 
 
b3ecc7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import gradio as gr
from tool import BrightDataDatasetTool

tool = BrightDataDatasetTool()

def run(dataset, url, keyword, first_name, last_name, days_limit, num_of_reviews, num_of_comments):
    return tool(
        dataset=dataset,
        url=url,
        keyword=keyword,
        first_name=first_name,
        last_name=last_name,
        days_limit=days_limit,
        num_of_reviews=num_of_reviews,
        num_of_comments=num_of_comments,
    )

with gr.Blocks() as demo:
    gr.Markdown("### Bright Data dataset fetch")
    dataset = gr.Dropdown(choices=['amazon_product', 'amazon_product_reviews', 'amazon_product_search', 'apple_app_store', 'bestbuy_products', 'booking_hotel_listings', 'crunchbase_company', 'ebay_product', 'etsy_products', 'facebook_company_reviews', 'facebook_events', 'facebook_marketplace_listings', 'facebook_posts', 'github_repository_file', 'google_maps_reviews', 'google_play_store', 'google_shopping', 'homedepot_products', 'instagram_comments', 'instagram_posts', 'instagram_profiles', 'instagram_reels', 'linkedin_company_profile', 'linkedin_job_listings', 'linkedin_people_search', 'linkedin_person_profile', 'linkedin_posts', 'reddit_posts', 'reuter_news', 'tiktok_comments', 'tiktok_posts', 'tiktok_profiles', 'tiktok_shop', 'walmart_product', 'walmart_seller', 'x_posts', 'yahoo_finance_business', 'youtube_comments', 'youtube_profiles', 'youtube_videos', 'zara_products', 'zillow_properties_listing', 'zoominfo_company_profile'], label="Dataset", multiselect=False)
    url = gr.Textbox(label="URL", placeholder="https://...")
    keyword = gr.Textbox(label="Keyword")
    first_name = gr.Textbox(label="First name")
    last_name = gr.Textbox(label="Last name")
    days_limit = gr.Textbox(label="Days limit (e.g. 3)")
    num_of_reviews = gr.Textbox(label="Number of reviews")
    num_of_comments = gr.Textbox(label="Number of comments")
    run_btn = gr.Button("Run")
    output = gr.Textbox(label="Output", lines=12)
    run_btn.click(
        run,
        inputs=[dataset, url, keyword, first_name, last_name, days_limit, num_of_reviews, num_of_comments],
        outputs=output,
    )

demo.launch()