nniehaus commited on
Commit
cc53428
·
verified ·
1 Parent(s): bc46207

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -15
app.py CHANGED
@@ -13,6 +13,10 @@ def scrape_website(url, max_pages=5):
13
  Crawls and scrapes content from the given website URL.
14
  Follows internal links and extracts meaningful information from up to `max_pages` pages.
15
  """
 
 
 
 
16
  visited = set()
17
  to_visit = [url]
18
  all_content = []
@@ -55,12 +59,15 @@ initial_messages = [{
55
  "role": "system",
56
  "content": """You are a world-class marketing strategist trained by Neil Patel, David Ogilvy, and Seth Godin.
57
  You specialize in creating precise, highly actionable, and detailed 1-year marketing plans tailored to businesses' specific needs.
58
- For every strategy you suggest, include 3 to 5 detailed, actionable steps that explain how to implement it.
59
- Ensure each plan considers the business's industry, budget, goals, and current strengths as reflected in the provided information.
60
-
61
- Your advice should feel like it is coming from a personal consultant who deeply understands the business. Go beyond generalities,
62
- and include specific suggestions for platforms, tools, campaigns, or techniques. If applicable, suggest measurable KPIs to track success.
63
- If the company is already doing well in some areas, suggest how they can take those efforts to the next level."""
 
 
 
64
  }]
65
 
66
  def call_openai_api(messages):
@@ -86,15 +93,16 @@ def generate_marketing_plan(website_content, industry, goals, budget, messages):
86
  - Goals for 2025: {goals}
87
  - Marketing budget for 2025: ${budget}
88
 
89
- Based on this information, create a comprehensive, customized 1-year marketing plan for 2025.
90
- Your output should include:
91
- 1. **Content Marketing**: Suggestions for blogs, videos, or other content types. Provide 3-5 actionable steps for implementation.
92
- 2. **Social Media Strategy**: Recommend specific platforms, posting frequency, and campaign ideas, with measurable goals or KPIs.
93
- 3. **Advertising Campaigns**: Outline paid ad strategies (e.g., Google Ads, Facebook Ads). Include budget allocation and expected ROI.
94
- 4. **Search Engine Optimization (SEO)**: Suggest improvements or new tactics, including tools or techniques they can use.
95
- 5. **Innovative Approaches**: Any unique or industry-specific ideas that would differentiate this business.
 
96
 
97
- For each strategy, explain how it aligns with the business's goals and utilizes its current strengths. Provide a quarterly timeline to help them implement these strategies effectively."""
98
 
99
  messages.append({"role": "user", "content": query})
100
  return call_openai_api(messages)
@@ -113,7 +121,7 @@ st.markdown("<h1 style='text-align: center; color: black;'>2025 Marketing Planne
113
  col1, col2 = st.columns(2)
114
  with col1:
115
  st.markdown("<h2 style='text-align: center; color: black;'>Enter Business Details</h2>", unsafe_allow_html=True)
116
- website_url = st.text_input("Enter your business website", placeholder="https://example.com")
117
  industry = st.text_input("Industry", placeholder="E.g., Real Estate, Retail, Technology")
118
  goals = st.text_area("Goals for 2025", placeholder="E.g., increase brand awareness, drive online sales")
119
  budget = st.number_input("Marketing Budget for 2025 ($)", min_value=1000, step=1000)
 
13
  Crawls and scrapes content from the given website URL.
14
  Follows internal links and extracts meaningful information from up to `max_pages` pages.
15
  """
16
+ # Ensure URL has the correct format
17
+ if not url.startswith("http"):
18
+ url = f"https://{url}"
19
+
20
  visited = set()
21
  to_visit = [url]
22
  all_content = []
 
59
  "role": "system",
60
  "content": """You are a world-class marketing strategist trained by Neil Patel, David Ogilvy, and Seth Godin.
61
  You specialize in creating precise, highly actionable, and detailed 1-year marketing plans tailored to businesses' specific needs.
62
+ For every strategy you suggest, include:
63
+ - Lists of specific keywords for blogs, videos, or SEO.
64
+ - Titles and topics for YouTube videos, blog posts, or other content.
65
+ - Ad campaign structures, including target audiences and platforms.
66
+ - Step-by-step implementation details for each suggestion.
67
+ - Measurable KPIs or success metrics.
68
+
69
+ Your advice must be execution-ready, requiring minimal further planning by the business owner.
70
+ Leverage the website information provided to deeply customize your suggestions, ensuring alignment with the business's goals and strengths."""
71
  }]
72
 
73
  def call_openai_api(messages):
 
93
  - Goals for 2025: {goals}
94
  - Marketing budget for 2025: ${budget}
95
 
96
+ Create a comprehensive, customized 1-year marketing plan for 2025.
97
+ Include:
98
+ 1. **Keywords**: Provide a list of specific keywords to target for blogs, videos, and SEO.
99
+ 2. **Content Topics**: Suggest blog and YouTube video topics with detailed titles.
100
+ 3. **Social Media**: Recommend platforms, posting frequency, and campaign ideas with measurable goals.
101
+ 4. **Advertising Campaigns**: Outline paid ad strategies, including platforms, target audiences, and budget allocation.
102
+ 5. **SEO Improvements**: Suggest tools, techniques, and steps to improve search rankings.
103
+ 6. **Execution Steps**: Provide actionable, step-by-step instructions for each recommendation.
104
 
105
+ Ensure all suggestions align with the business's goals and strengths, and include a quarterly timeline for implementation."""
106
 
107
  messages.append({"role": "user", "content": query})
108
  return call_openai_api(messages)
 
121
  col1, col2 = st.columns(2)
122
  with col1:
123
  st.markdown("<h2 style='text-align: center; color: black;'>Enter Business Details</h2>", unsafe_allow_html=True)
124
+ website_url = st.text_input("Enter your business website", placeholder="example.com (no need for https://)")
125
  industry = st.text_input("Industry", placeholder="E.g., Real Estate, Retail, Technology")
126
  goals = st.text_area("Goals for 2025", placeholder="E.g., increase brand awareness, drive online sales")
127
  budget = st.number_input("Marketing Budget for 2025 ($)", min_value=1000, step=1000)