Spaces:
Configuration error
Configuration error
| """ | |
| resumate.py | |
| A simple Gradio UI for collecting user profile and job post URLs. | |
| This app provides three text input fields for: | |
| - LinkedIn profile URL | |
| - GitHub profile URL | |
| - LinkedIn job post URL | |
| Upon submission, the input values are displayed in the output box. | |
| To run: | |
| python resumate.py | |
| """ | |
| import gradio as gr | |
| from functions.context_acquisition import get_linkedin_profile_html | |
| def process_inputs(linkedin_url, github_url, job_post_url): | |
| """ | |
| Process the input URLs and retrieve content from LinkedIn profile. | |
| Args: | |
| linkedin_url (str): LinkedIn profile URL | |
| github_url (str): GitHub profile URL | |
| job_post_url (str): LinkedIn job post URL | |
| Returns: | |
| str: Formatted output with URL information and LinkedIn profile status | |
| """ | |
| result = f"LinkedIn: {linkedin_url}\nGitHub: {github_url}\nJob Post: {job_post_url}\n\n" | |
| # Try to retrieve LinkedIn profile HTML if URL is provided | |
| if linkedin_url and linkedin_url.strip(): | |
| try: | |
| result += "Attempting to retrieve LinkedIn profile...\n" | |
| html_content = get_linkedin_profile_html(linkedin_url) | |
| result += f"LinkedIn profile HTML ({len(html_content)} characters)\n" | |
| except Exception as e: # pylint: disable=broad-exception-caught | |
| result += f"❌ Failed to retrieve LinkedIn profile: {str(e)}\n" | |
| return result | |
| with gr.Blocks() as demo: | |
| gr.Markdown("# Resumate: Profile & Job Post Input") | |
| linkedin_profile = gr.Textbox( | |
| label="LinkedIn Profile URL", | |
| placeholder="Enter your LinkedIn profile URL" | |
| ) | |
| github_profile = gr.Textbox( | |
| label="GitHub Profile URL", | |
| placeholder="Enter your GitHub profile URL" | |
| ) | |
| job_post = gr.Textbox( | |
| label="LinkedIn Job Post URL", | |
| placeholder="Enter the LinkedIn job post URL" | |
| ) | |
| submit_btn = gr.Button("Submit") | |
| output = gr.Textbox(label="Output", lines=3) | |
| submit_btn.click( # pylint: disable=no-member | |
| process_inputs, | |
| inputs=[linkedin_profile, github_profile, job_post], | |
| outputs=output | |
| ) | |
| demo.launch() |