File size: 8,875 Bytes
cac9eab bc46207 2199ab8 ae1693c df7994d 29a733a df7994d ae1693c a8c7ff3 ae1693c 0f5606e ae1693c 0f5606e ae1693c 0f5606e ae1693c a1c21f2 37f8d8a a1c21f2 0f5606e 41c2a71 0f5606e 29a733a 2199ab8 df7994d 29a733a 0f5606e 29a733a 0f5606e 29a733a 51ff7fb 2199ab8 29a733a 4ab4a0c 29a733a 2199ab8 2f74528 ae1693c 41c2a71 0f5606e 41c2a71 4ab4a0c ae1693c 41c2a71 ae1693c 4ab4a0c ae1693c 29a733a ae1693c 0f5606e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
import streamlit as st
import requests
import os
from bs4 import BeautifulSoup
# Configure DeepSeek
DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY")
DEEPSEEK_ENDPOINT = "https://api.deepseek.com/v1/chat/completions"
def scrape_website(url, max_pages=3):
"""Scrapes content from the given website URL."""
if not url.startswith("http"):
url = f"https://{url}"
try:
response = requests.get(url, timeout=10)
response.raise_for_status()
soup = BeautifulSoup(response.content, "html.parser")
# Extract meaningful content
content = []
# Get meta description
meta_description = soup.find("meta", {"name": "description"})
if meta_description and meta_description.get("content"):
content.append(meta_description["content"])
# Get main content
for tag in ['h1', 'h2', 'p']:
elements = soup.find_all(tag)
content.extend([elem.get_text(strip=True) for elem in elements if elem.get_text(strip=True)])
return " ".join(content[:1500])
except Exception as e:
st.error(f"Error scraping website: {str(e)}")
return None
def generate_marketing_plan(business_info):
"""Generate comprehensive video marketing plan using DeepSeek"""
prompt = f"""As a video marketing strategist specializing in conversion optimization, create a comprehensive video funnel strategy based on this business information:
{business_info}
Develop a sophisticated 12-month video marketing strategy that includes:
1. CORE STRATEGY
- First, summarize the overall strategy you recommend and how you expect it to deliver results for the business.
- Identify 3 unique angles or approaches that would differentiate this business's video content, ensuring that these are approaches that make the business stand out from their competitors
- Suggest innovative ways to showcase the business's unique value proposition
- Recommend specific storytelling techniques that would resonate with their target audience
2. FUNNEL ARCHITECTURE
For each stage below, provide specific video content ideas that move prospects forward:
- Awareness: Pattern interruption content that stops the scroll and helps the viewer meet the busines for the first time
- Considertion: Trust-building content that demonstrates expertise
- Conversion: Conversion content that overcomes objections
- Post-Purchase: Retention content that drives referrals
3. CONTENT BLUEPRINTS
For the 3 most important videos identified:
- Detailed content outline
- Key messaging points
- Specific hooks to grab attention
- Call-to-action strategy
- Ideal length and format
- Platform-specific optimizations
4. PRODUCTION GUIDELINES
- Visual style recommendations
- Music and sound design suggestions
- Text overlay strategies
- Thumbnail design principles
- Specific examples of successful videos to model
5. DISTRIBUTION STRATEGY
- Primary platform strategy with posting frequency
- Cross-platform repurposing guide
- Hashtag and keyword recommendations
- Best times to post
- Community engagement tactics
6. MEASUREMENT FRAMEWORK
- Primary KPIs for each funnel stage
- Engagement metrics to track
- Conversion tracking setup
- A/B testing recommendations
- Monthly review process
Format the response with clear markdown headers and bullet points. Focus on providing unique, specific recommendations rather than generic advice. Include actual examples and detailed tactics whenever possible.
For each recommendation, explain the strategic reasoning behind it so the business understands not just what to do, but why it matters for their specific situation."""
headers = {
"Authorization": f"Bearer {DEEPSEEK_API_KEY}",
"Content-Type": "application/json"
}
data = {
"model": "deepseek-chat",
"messages": [
{
"role": "system",
"content": """You are a leading video marketing strategist who combines the philosophical approaches of:
- Gary Vaynerchuk's pattern interruption and documenting-over-creating methodology
- Alex Hormozi's high-ticket offer presentation framework
- Mr Beast's viral engineering techniques and thumbnail psychology
- Alyssa Ago's short-form storytelling frameworks
- Owen Video's Video 10x Strategy
- Think Media's platform-specific optimization tactics
You've spent 15 years helping businesses build video marketing funnels that convert. Your approach is influenced by:
- Russell Brunson's Value Ladder concept
- Donald Miller's StoryBrand Framework
- Seth Godin's Permission Marketing
- Joe Pulizzi's Content Inc. Methodology
Your specific expertise includes:
- Behavioral psychology in video engagement (attention triggers, pattern interrupts, hooks)
- Platform-specific algorithms (YouTube, TikTok, Instagram, LinkedIn)
- Video SEO and discoverability optimization
- Short-form vs long-form content strategy
- Retention curve analysis and optimization
- Multi-platform content distribution
- Thumb-stopping content creation
- Video conversion rate optimization
- Analytics and performance tracking
For each business, you create custom strategies that:
1. Focus on their unique market position
2. Leverage their specific competitive advantages
3. Address their target audience's scroll patterns
4. Account for their resource constraints
5. Build toward their business objectives
Your recommendations are always specific, actionable, and based on proven case studies from your work with similar businesses."""
},
{"role": "user", "content": prompt}
],
"temperature": 0.7,
"max_tokens": 4000
}
try:
response = requests.post(DEEPSEEK_ENDPOINT, json=data, headers=headers)
response.raise_for_status()
return response.json()["choices"][0]["message"]["content"]
except Exception as e:
st.error(f"API Error: {str(e)}")
return None
# Streamlit UI
st.set_page_config(page_title="Video Funnel Generator", layout="wide")
st.title("🎥 AI Video Marketing Strategist")
st.markdown("### Generate a comprehensive video marketing funnel for your business")
# Input method selection
input_method = st.radio(
"Choose input method:",
["Enter business details manually", "Use website URL"]
)
if input_method == "Enter business details manually":
business_name = st.text_input("Business Name*")
business_description = st.text_area(
"What does your company do?*",
help="Describe your products/services and what makes you unique"
)
ideal_client = st.text_area(
"Describe your ideal client. Include more details for a better funnel plan.*",
help="Include demographics, challenges they face, and why they need your solution"
)
current_marketing = st.text_area(
"Current marketing efforts (optional)",
help="What marketing strategies are you currently using? What's working/not working?"
)
if st.button("Generate Marketing Plan"):
if not all([business_name, business_description, ideal_client]):
st.error("Please fill in all required fields marked with *")
else:
with st.spinner("Creating your custom video marketing strategy..."):
business_info = f"""
Business Name: {business_name}
Business Description: {business_description}
Ideal Client Profile: {ideal_client}
Current Marketing: {current_marketing if current_marketing else 'Not provided'}
"""
plan = generate_marketing_plan(business_info)
if plan:
st.markdown(plan)
else:
website_url = st.text_input(
"Enter your website URL*",
placeholder="e.g., www.example.com"
)
if st.button("Generate Marketing Plan"):
if not website_url:
st.error("Please enter your website URL")
else:
with st.spinner("Analyzing your website and creating your marketing strategy..."):
website_content = scrape_website(website_url)
if website_content:
plan = generate_marketing_plan(website_content)
if plan:
st.markdown(plan) |