CareerPortal / app.py
engrharis's picture
Update app.py
bf8127e verified
import streamlit as st
# Expanded list of Pakistani cities
cities = [
"Karachi", "Lahore", "Islamabad", "Rawalpindi", "Peshawar", "Quetta",
"Faisalabad", "Multan", "Sialkot", "Hyderabad", "Gujranwala", "Bahawalpur",
"Abbottabad", "Sargodha", "Mardan", "Mirpur", "Sukkur", "Larkana",
"Chiniot", "Sheikhupura", "Gujrat", "Jhelum", "Dera Ghazi Khan", "Nawabshah"
]
# Platforms with job search URLs
platforms = {
"LinkedIn": "https://www.linkedin.com/jobs/search/?keywords={job}&location={city}",
"Indeed": "https://pk.indeed.com/jobs?q={job}&l={city}",
"National Job Portal": "https://njp.gov.pk/job_search?keywords={job}&city={city}"
}
# App Title
st.title("Job Search Portal")
# User Inputs
st.subheader("Search for Jobs in Pakistan")
selected_city = st.selectbox("Select your city:", cities)
job_keyword = st.text_input("Enter job title or keywords:")
selected_platform = st.selectbox("Choose the job platform:", list(platforms.keys()))
# Show the Search button and create the link if clicked
if st.button("Search Jobs"):
if not job_keyword.strip():
st.warning("Please enter a job title or keyword.")
else:
# Construct the URL for the selected platform
base_url = platforms[selected_platform]
search_url = base_url.format(job=job_keyword.replace(" ", "+"), city=selected_city)
# Create the dynamic link for the platform
link_text = f"See {selected_platform} Jobs in {selected_city}"
# Display the dynamic link
st.markdown(f"[{link_text}]({search_url})", unsafe_allow_html=True)
st.success(f"Click the link above to see jobs on {selected_platform}.")