Update app.py
Browse files
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
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
| 90 |
-
|
| 91 |
-
1. **
|
| 92 |
-
2. **
|
| 93 |
-
3. **
|
| 94 |
-
4. **
|
| 95 |
-
5. **
|
|
|
|
| 96 |
|
| 97 |
-
|
| 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="
|
| 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)
|