File size: 15,042 Bytes
cac9eab
b70f7b6
be6e021
 
 
 
0c9db36
be6e021
 
 
 
 
 
 
b2662d0
 
 
 
be6e021
 
 
 
b2662d0
be6e021
b2662d0
 
 
 
 
be6e021
 
 
 
 
 
b2662d0
b70f7b6
be6e021
 
df7994d
be6e021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae1693c
be6e021
 
 
 
 
 
 
 
ae1693c
be6e021
13874ca
be6e021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13874ca
 
be6e021
13874ca
be6e021
 
 
13874ca
 
 
be6e021
ae1693c
be6e021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51ff7fb
2199ab8
b70f7b6
 
 
be6e021
 
 
b70f7b6
 
29a733a
be6e021
2f74528
be6e021
 
3610532
be6e021
 
 
 
 
 
 
4ab4a0c
be6e021
 
 
ae1693c
be6e021
 
 
 
 
 
 
 
3610532
be6e021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3610532
be6e021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4ab4a0c
be6e021
 
3610532
be6e021
 
3610532
be6e021
 
 
 
 
 
3610532
 
be6e021
 
 
 
 
 
 
 
 
 
 
3610532
be6e021
3610532
be6e021
 
 
 
 
 
 
 
 
3610532
be6e021
 
 
 
 
 
 
3610532
be6e021
 
 
 
 
 
 
 
 
 
 
 
 
 
3610532
be6e021
 
 
 
 
 
 
 
3610532
be6e021
 
 
 
 
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
import streamlit as st
from openai import OpenAI
import os
import json
from datetime import datetime, timedelta
import streamlit.components.v1 as components

def render_ghl_form():
    """
    Renders the GoHighLevel form using iframe embed
    """
    ghl_form_html = """
    <div style="margin: 20px 0;">
        <iframe
            src="https://api.leadconnectorhq.com/widget/form/owzd46RCCEOSQv9u242m"
            style="width:100%;height:946px;border:none;border-radius:10px;box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);"
            id="inline-owzd46RCCEOSQv9u242m" 
            data-layout="{'id':'INLINE'}"
            data-trigger-type="alwaysShow"
            data-trigger-value=""
            data-activation-type="alwaysActivated"
            data-activation-value=""
            data-deactivation-type="leadCollected"
            data-deactivation-value=""
            data-form-name="Marcus Form 1"
            data-height="946"
            data-layout-iframe-id="inline-owzd46RCCEOSQv9u242m"
            data-form-id="owzd46RCCEOSQv9u242m"
            title="Marcus Form 1"
        >
        </iframe>
        <script src="https://link.msgsndr.com/js/form_embed.js"></script>
    </div>
    """
    
    components.html(ghl_form_html, height=980)

# Initialize OpenAI client
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

def search_current_trends():
    """
    Uses AI to generate current real estate trends and seasonal content ideas
    """
    current_month = datetime.now().strftime("%B")
    current_year = datetime.now().year
    
    prompt = f"""
    As a real estate marketing expert, provide current trends and seasonal opportunities for {current_month} {current_year}.
    Include:
    1. Current market trends
    2. Seasonal real estate topics
    3. Popular hashtags
    4. Trending video formats
    5. Local market opportunities
    
    Focus on what's working NOW in real estate video marketing.
    """
    
    try:
        response = client.chat.completions.create(
            model="gpt-4",
            messages=[
                {"role": "system", "content": "You are a real estate marketing expert with deep knowledge of current trends and seasonal opportunities."},
                {"role": "user", "content": prompt}
            ]
        )
        return response.choices[0].message.content
    except Exception as e:
        return f"Unable to fetch current trends: {str(e)}"

def generate_content_calendar(realtor_info, market_area, specialties, target_audience, brand_style, current_trends):
    """
    Generates a comprehensive 30-day video content calendar for realtors
    """
    
    calendar_prompt = f"""
    Create a detailed 30-day video content calendar for a realtor with these details:
    
    Realtor Information: {realtor_info}
    Market Area: {market_area}
    Specialties: {specialties}
    Target Audience: {target_audience}
    Brand Style: {brand_style}
    Current Trends: {current_trends}
    
    For each day (1-30), provide:
    
    **Day X: [Video Title]**
    - **Content Type**: [Educational/Behind-the-scenes/Market Update/Client Testimonial/Property Showcase/etc.]
    - **Platform**: [Primary platform - YouTube/Instagram/TikTok/Facebook]
    - **Duration**: [Recommended length]
    - **Hook**: [Opening line to grab attention]
    - **Key Points**: [3-4 main talking points]
    - **Call-to-Action**: [Specific action for viewers]
    - **Hashtags**: [5-8 relevant hashtags]
    - **Equipment Needed**: [Phone/Professional camera/Drone/etc.]
    - **Location**: [Office/Property/Neighborhood/Home/etc.]
    
    **Weekly Themes:**
    - Week 1: Market Education & Expertise
    - Week 2: Behind the Scenes & Personal Brand
    - Week 3: Client Success Stories & Social Proof
    - Week 4: Market Updates & Future Trends
    - Days 29-30: Month Recap & Next Month Preview
    
    **Content Mix Guidelines:**
    - 40% Educational content
    - 25% Property showcases and market updates
    - 20% Behind-the-scenes and personal branding
    - 15% Client testimonials and success stories
    
    Make each video idea specific, actionable, and designed to establish the realtor as a local market expert while building trust and generating leads.
    
    Include seasonal relevance and current market conditions in the content suggestions.
    """
    
    try:
        response = client.chat.completions.create(
            model="gpt-4",
            messages=[
                {"role": "system", "content": "You are a top-tier real estate video marketing strategist who creates viral content calendars that generate leads and establish realtors as local market experts."},
                {"role": "user", "content": calendar_prompt}
            ]
        )
        return response.choices[0].message.content
    except Exception as e:
        return f"Error generating calendar: {str(e)}. Please check your OpenAI API key and try again."

def generate_bonus_resources(market_area, specialties):
    """
    Generates bonus resources including templates and scripts
    """
    
    resources_prompt = f"""
    Create bonus resources for a realtor in {market_area} specializing in {specialties}:
    
    1. **5 Video Script Templates** (with fill-in-the-blank sections)
    2. **10 Engaging Video Hooks** for different content types
    3. **Social Media Posting Schedule** with optimal times
    4. **Video SEO Keywords** for their market area
    5. **Equipment Recommendations** by budget level
    6. **Trending Audio/Music Suggestions** for each platform
    
    Make everything specific to real estate video marketing and lead generation.
    """
    
    try:
        response = client.chat.completions.create(
            model="gpt-4",
            messages=[
                {"role": "system", "content": "You are a real estate marketing expert specializing in video content creation and lead generation strategies."},
                {"role": "user", "content": resources_prompt}
            ]
        )
        return response.choices[0].message.content
    except Exception as e:
        return f"Error generating resources: {str(e)}"

# Streamlit setup
st.set_page_config(page_title="Realtor Video Content Calendar", layout="wide")

# Initialize session state
if "calendar_content" not in st.session_state:
    st.session_state["calendar_content"] = None
if "bonus_resources" not in st.session_state:
    st.session_state["bonus_resources"] = None
if "show_notice" not in st.session_state:
    st.session_state["show_notice"] = False

# Header
st.markdown("<h1 style='text-align: center; color: #2E4057;'>πŸŽ₯ 30-Day Video Content Calendar for Realtors</h1>", unsafe_allow_html=True)
st.markdown("<h3 style='text-align: center; color: #666;'>Generate More Leads Through Strategic Video Marketing</h3>", unsafe_allow_html=True)

# Create two columns for input
col1, col2 = st.columns(2)

with col1:
    st.markdown("### πŸ“‹ Realtor Information")
    realtor_name = st.text_input("Realtor Name", placeholder="John Smith")
    brokerage = st.text_input("Brokerage", placeholder="ABC Realty")
    years_experience = st.number_input("Years in Real Estate", min_value=0, max_value=50, value=5)
    
    st.markdown("### 🎯 Target Market")
    market_area = st.text_input("Primary Market Area", placeholder="Downtown Austin, TX")
    specialties = st.multiselect(
        "Specialties",
        ["First-time Homebuyers", "Luxury Properties", "Investment Properties", 
         "Commercial Real Estate", "Relocation Services", "Senior Housing",
         "New Construction", "Foreclosures/REO", "Land/Lots"]
    )

with col2:
    st.markdown("### πŸ‘₯ Audience & Style")
    target_audience = st.selectbox(
        "Primary Target Audience",
        ["First-time Homebuyers (25-35)", "Move-up Buyers (35-45)", "Luxury Buyers (45+)",
         "Investors", "Empty Nesters", "Young Families", "Millennials", "Gen Z"]
    )
    
    brand_style = st.selectbox(
        "Brand Personality",
        ["Professional & Trustworthy", "Fun & Energetic", "Luxury & Sophisticated",
         "Down-to-earth & Relatable", "Tech-savvy & Modern", "Community-focused"]
    )
    
    video_experience = st.selectbox(
        "Video Creation Experience",
        ["Beginner (just starting)", "Intermediate (some experience)", 
         "Advanced (regular creator)"]
    )

# Additional preferences
st.markdown("### βš™οΈ Content Preferences")
col3, col4 = st.columns(2)

with col3:
    primary_platforms = st.multiselect(
        "Primary Social Media Platforms",
        ["Instagram", "TikTok", "YouTube", "Facebook", "LinkedIn"],
        default=["Instagram", "YouTube"]
    )

with col4:
    content_focus = st.multiselect(
        "Content Focus Areas",
        ["Market Education", "Property Tours", "Neighborhood Spotlights",
         "Home Buying/Selling Tips", "Market Updates", "Personal Branding",
         "Client Success Stories", "Behind-the-scenes"],
        default=["Market Education", "Property Tours", "Home Buying/Selling Tips"]
    )

# Contact Information Form
st.markdown("---")
st.markdown("### πŸ“ž Get Your Free 30-Day Video Calendar")
st.markdown("*Complete the form below to receive your personalized video content strategy:*")

# Render the GoHighLevel form
render_ghl_form()

# Simple generate button that doesn't require form validation
# Since the GHL form handles contact capture
generate_button = st.button('πŸš€ Generate My 30-Day Video Calendar', type="primary")

# Process results on button click
if generate_button:
    # Validate required fields for calendar generation
    if not realtor_name or not market_area:
        st.error("Please fill in at least the Realtor Name and Primary Market Area to generate your calendar.")
    else:
        st.session_state["show_notice"] = True
        
        with st.spinner("πŸ” Researching current market trends and generating your personalized video calendar..."):
            # Compile realtor information
            specialties_str = ", ".join(specialties) if specialties else "General Real Estate"
            platforms_str = ", ".join(primary_platforms) if primary_platforms else "All platforms"
            focus_str = ", ".join(content_focus) if content_focus else "General content"
            
            realtor_info = f"{realtor_name} from {brokerage} with {years_experience} years of experience. Video experience level: {video_experience}. Focuses on: {focus_str}. Uses platforms: {platforms_str}"
            
            # Get current trends
            current_trends = search_current_trends()
            
            # Generate the calendar
            st.session_state["calendar_content"] = generate_content_calendar(
                realtor_info, market_area, specialties_str, target_audience, brand_style, current_trends
            )
            
            # Generate bonus resources
            st.session_state["bonus_resources"] = generate_bonus_resources(market_area, specialties_str)
            
        st.session_state["show_notice"] = False
        st.success(f"βœ… Your personalized video calendar has been generated! Please complete the contact form above to access additional resources.")

# Display the waiting notice
if st.session_state["show_notice"]:
    st.info("🎬 Creating your personalized 30-day video content calendar... This may take 1-2 minutes.")

# Display results
if st.session_state["calendar_content"]:
    st.markdown("---")
    st.markdown("<h2 style='text-align: center; color: #2E4057;'>πŸ“… Your 30-Day Video Content Calendar</h2>", unsafe_allow_html=True)
    
    # Create tabs for better organization
    tab1, tab2 = st.tabs(["πŸ“‹ Content Calendar", "🎁 Bonus Resources"])
    
    with tab1:
        st.markdown(st.session_state["calendar_content"])
        
        # Download option
        st.download_button(
            label="πŸ“₯ Download Calendar as Text File",
            data=st.session_state["calendar_content"],
            file_name=f"30_day_video_calendar_{datetime.now().strftime('%Y%m%d')}.txt",
            mime="text/plain"
        )
    
    with tab2:
        if st.session_state["bonus_resources"]:
            st.markdown(st.session_state["bonus_resources"])
            
            # Download option for resources
            st.download_button(
                label="πŸ“₯ Download Resources as Text File",
                data=st.session_state["bonus_resources"],
                file_name=f"video_marketing_resources_{datetime.now().strftime('%Y%m%d')}.txt",
                mime="text/plain"
            )

# Footer with loan originator value proposition
st.markdown("---")
st.markdown("""
<div style='background-color: white; color: #374151; padding: 25px; border-radius: 10px; margin-top: 30px; border: 2px solid #e5e7eb; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);'>
<h2 style='color: #1f2937; text-align: center; margin-bottom: 20px;'>🏑 Powered by Western Pioneer Financial</h2>
<div style='text-align: center; margin-bottom: 20px;'>
<h3 style='color: #1f2937; margin-bottom: 10px;'>Marcus Cavazos - Loan Originator</h3>
<p style='font-size: 16px; margin-bottom: 15px; color: #6b7280;'>
πŸ“§ <strong style='color: #1f2937;'>mcavazos@wpfloans.com</strong> | 🏦 <strong style='color: #1f2937;'>NMLS#1938369</strong>
</p>
</div>

<div style='background-color: #f9fafb; padding: 20px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #e5e7eb;'>
<h4 style='color: #1f2937; text-align: center; margin-bottom: 15px;'>🀝 Partnership That Grows Your Business</h4>
<p style='text-align: center; font-size: 16px; line-height: 1.6; color: #374151;'>
This free video marketing tool is just one way I support realtors in building their business. 
When your clients need financing, I provide the exceptional loan services that help you close more deals faster.
</p>
</div>

<div style='display: flex; justify-content: space-around; flex-wrap: wrap; margin: 20px 0;'>
<div style='text-align: center; margin: 10px;'>
<h4 style='color: #1f2937;'>⚑ Fast Pre-Approvals</h4>
<p style='margin: 5px 0; color: #6b7280;'>Same-day pre-approval letters</p>
</div>
<div style='text-align: center; margin: 10px;'>
<h4 style='color: #1f2937;'>πŸ† Competitive Rates</h4>
<p style='margin: 5px 0; color: #6b7280;'>Best rates for your clients</p>
</div>
<div style='text-align: center; margin: 10px;'>
<h4 style='color: #1f2937;'>πŸ“ž Direct Communication</h4>
<p style='margin: 5px 0; color: #6b7280;'>Always available for updates</p>
</div>
</div>

<div style='text-align: center; margin-top: 20px;'>
<p style='font-size: 18px; font-weight: bold; color: #1f2937;'>
Ready to partner with a loan originator who invests in your success?
</p>
<p style='font-size: 16px; margin-top: 10px; color: #374151;'>
Contact me today to discuss how we can work together to close more deals.
</p>
</div>

<div style='text-align: center; font-size: 12px; margin-top: 20px; color: #9ca3af;'>
Western Pioneer Financial | NMLS#1938369 | Equal Housing Opportunity Lender
</div>
</div>
""", unsafe_allow_html=True)