Spaces:
Sleeping
Sleeping
| 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() | |