Spaces:
Build error
Build error
add sem/seo
#3
by notjulietxd - opened
3 unmodified lines45678910111213141516171819202122232425262728293031323334353637383940414243444546474817 unmodified lines66676869707172737475767778798081828384858687888990913 unmodified linesfrom helper.data_field import get_analyst_responseimport timest.set_page_config(layout="centered") # <--- Add this linedef display_outputs():client_name = "RMX Creatives"overview = f"""**{client_name}** is a financial services company based in Auckland, New Zealand, specializing in providing quick and flexible loan solutions for businesses and individuals. Represented by Paul Stone, LoansOne has enlisted ShoreMarketing to perform a deep dive into their digital footprint to have a view of the holistic status of their digital properties and determine how each property can play part in implementing a stronger digital marketing plan.\nThe Digital Marketing Footprint consists of deep-dive research by ShoreMarketing specialists to help the business leaders of LoansOne understand the effectiveness of their existing digital initiatives with the view of giving them an insight to developing a strategy and effectively allocating business resources to digital properties that will give them the best results.\nThis document represents the results of our audit of LoansOne’s digital marketing and management practices. Our audit covered reviews of key digital areas: Website and Tools, PPC/SEM, SEO, Social Media, and Market Places."""website_and_tools_data = get_analyst_response("Website and Tools Analyst")# seo = data_field("SEO")# social_media = data_field("Social Media")# (off_page_thread)# (on_page_thread)# (website_and_tools_thread)# (seo_thread)# (social_media_thread)st.markdown("## Digital Marketing Audit")st.markdown(f"### {client_name}")st.markdown("## DIGITAL FOOTPRINT OVERVIEW")st.markdown(f"{overview}")st.markdown("## WEBSITE AND TOOLS")st.markdown(f"""In today’s digital age, scaling a business is simply impossible without a website. Websites primarily serve as the center for all online conversions, which makes it equally important to guarantee that all pages are optimised to educate all traffic about the brand and ultimately to usher them into conversion. \nIn line with this, we have looked into the technology used by **{client_name}** as well as the different digital channels currently in place to see how they are structured and how they are performing.""")# --- Start: Loop and display data as Markdown table ---if website_and_tools_data:try:# If get_analyst_response returns a JSON string, parse it:# parsed_data = json.loads(website_and_tools_data)# If get_analyst_response returns a Python list/dict directly:parsed_data = website_and_tools_data# Check if the parsed data is a list (expected format for a table)if isinstance(parsed_data, list):# Create Markdown table headermarkdown_table = "| Category | Current Footprint | Best of Breed Solution |\n"markdown_table += "|---|---|---|\n"# Loop through the list of dictionaries17 unmodified lines# Handle case if data is not a list (e.g., a single dictionary)elif isinstance(parsed_data, dict):st.write("Website and Tools Analysis Result (Summary):")# You might want to display dictionary data differentlyst.json(parsed_data) # Example: Display as JSONelse:st.warning("Website and Tools data is not in the expected list format.")st.write(parsed_data) # Show the raw dataexcept json.JSONDecodeError:st.error("Error: Could not parse the Website and Tools data as JSON.")st.text(website_and_tools_data) # Show the raw string dataexcept AttributeError:st.error("Error: Could not find expected keys ('category', 'current_footprint', 'best_of_breed_solution') in the data.")st.write(parsed_data) # Show the data that caused the errorexcept Exception as e:st.error(f"An unexpected error occurred while processing Website and Tools data: {e}")st.write(website_and_tools_data) # Show the raw dataelse:st.warning("No data retrieved for Website and Tools analysis.")# --- End: Loop and display data ---if st.button("Back to Dashboard"):st.switch_page("pages/home.py")3 unmodified lines45678910111213141516171819202117 unmodified lines394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231243 unmodified linesfrom helper.data_field import get_analyst_responseimport timest.set_page_config(layout="centered")def write_table(website_and_tools_data):if website_and_tools_data:try:parsed_data = website_and_tools_dataif isinstance(parsed_data, list):# Create Markdown table headermarkdown_table = "| | Current Footprint | Best of Breed Solution |\n"markdown_table += "|---|---|---|\n"# Loop through the list of dictionaries17 unmodified lines# Handle case if data is not a list (e.g., a single dictionary)elif isinstance(parsed_data, dict):st.write("Analysis Result (Summary):")# You might want to display dictionary data differentlyst.json(parsed_data) # Example: Display as JSONelse:st.warning("data is not in the expected list format.")st.write(parsed_data) # Show the raw dataexcept json.JSONDecodeError:st.error("Error: Could not parse the data as JSON.")st.text(website_and_tools_data) # Show the raw string dataexcept AttributeError:st.error("Error: Could not find expected keys ('category', 'current_footprint', 'best_of_breed_solution') in the data.")st.write(parsed_data) # Show the data that caused the errorexcept Exception as e:st.error(f"An unexpected error occurred while processing data: {e}")st.write(website_and_tools_data) # Show the raw dataelse:st.warning("No data retrieved for analysis.")# --- End: Loop and display data ---def display_outputs():client_name = "RMX Creatives"overview = f"""**{client_name}** is a financial services company based in Auckland, New Zealand, specializing in providing quick and flexible loan solutions for businesses and individuals. Represented by Paul Stone, LoansOne has enlisted ShoreMarketing to perform a deep dive into their digital footprint to have a view of the holistic status of their digital properties and determine how each property can play part in implementing a stronger digital marketing plan.\nThe Digital Marketing Footprint consists of deep-dive research by ShoreMarketing specialists to help the business leaders of LoansOne understand the effectiveness of their existing digital initiatives with the view of giving them an insight to developing a strategy and effectively allocating business resources to digital properties that will give them the best results.\nThis document represents the results of our audit of LoansOne’s digital marketing and management practices. Our audit covered reviews of key digital areas: Website and Tools, PPC/SEM, SEO, Social Media, and Market Places."""st.markdown("# Digital Marketing Audit")st.markdown(f"{client_name}")st.write("")st.write("")st.write("")st.markdown("### DIGITAL FOOTPRINT OVERVIEW")st.markdown(f"{overview}")st.markdown("---")st.markdown("### Executive Summary")st.markdown(f"Simtech LED's digital footprint reveals significant strengths and areas for improvement that can enhance its competitive positioning in the casino, gaming, and entertainment LED market. The analysis highlights the following key findings and recommendations")st.markdown("---")st.markdown("### CLIENT FOOTPRINT")st.markdown(f"A")st.markdown("---")st.markdown("### SNAPSHOT BY CHANNEL")st.markdown(f"A")st.markdown("---")st.markdown("## AUDITS PER CHANNEL")st.markdown("### WEBSITE AND TOOLS")st.markdown(f"""In today’s digital age, scaling a business is simply impossible without a website. Websites primarily serve as the center for all online conversions, which makes it equally important to guarantee that all pages are optimised to educate all traffic about the brand and ultimately to usher them into conversion. \nIn line with this, we have looked into the technology used by **{client_name}** as well as the different digital channels currently in place to see how they are structured and how they are performing.""")# Write W&T Tablewebsite_and_tools_data = get_analyst_response("Website and Tools Analyst")write_table(website_and_tools_data)st.markdown("---")st.markdown("### SEARCH ENGINE MARKETING/PPC")st.markdown(f"""Search engine marketing, or SEM, is one of the most effective ways to grow a business in an increasingly competitive industry such as solar energy. This is one of the easiest way to be seen by the market almost instantly - but with the certain cost per user clicks. \nWith several businesses out there all vying for the same eyeballs, it’s never been more important to advertise online, and search engine marketing is the most effective way to promote need-based, high-investment products and services such as solar energy services.\nCurrently, {client_name} has already explored numerous online advertising. Its competitors are also experienced in PPC in multiple platforms. """)# Write W&T Tablesem_data = get_analyst_response("SEM PPC Analyst")write_table(sem_data)st.markdown("---")st.markdown("### SEARCH ENGINE OPTIMIZATION")st.markdown(f"""The purpose of Search Engine Optimization (SEO) is to strategically rearrange the website’s pages, attributes, content, and structure so that the website appears as high as possible in the results list displayed by search engines like Google, Bing, and Yahoo! when certain queries are entered by an internet user. Since high ranking positions are generally earned and worked for, ranking on the first page promotes trust between you and the search engine as well as to ultimately receive organic visibility with your users.\nThere are two types of SEO based on where the optimization is implemented: On-page SEO (which refers to any type of optimization done within the website) and Off-page SEO (which is often called Link Building or Link Acquisition – the process of getting more “votes” for the website through other domains). Both are essential in increasing a website’s visibility in search results pages and in ranking for more business-related keywords. """)# Write W&T Tableseo_data = get_analyst_response("SEO Analyst")write_table(seo_data)st.markdown("---")if st.button("Back to Dashboard"):st.switch_page("pages/home.py")
pages/output.py+71-38