Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -89,24 +89,25 @@ def generate_blogger_html(app_query, custom_link, mod_features, theme_color, tel
|
|
| 89 |
video_url = app_details.get('video', None)
|
| 90 |
|
| 91 |
# Mod Features Formatting
|
|
|
|
| 92 |
features_list = ""
|
| 93 |
for feature in mod_features.split(','):
|
| 94 |
if feature.strip():
|
| 95 |
-
features_list += f'<li style="margin-bottom:
|
| 96 |
|
| 97 |
# Screenshot HTML Generation
|
| 98 |
screenshots_html = ""
|
| 99 |
if screenshots:
|
| 100 |
-
screenshots_html = f'<h2 style="border-left:
|
| 101 |
for snap in screenshots:
|
| 102 |
-
screenshots_html += f'<img src="{snap}" style="height:
|
| 103 |
screenshots_html += '</div>'
|
| 104 |
|
| 105 |
# Video HTML Generation
|
| 106 |
video_html = ""
|
| 107 |
if video_url:
|
| 108 |
embed_url = video_url.replace("watch?v=", "embed/")
|
| 109 |
-
video_html = f'<h2 style="border-left:
|
| 110 |
|
| 111 |
# SEO Schemas (App, FAQ, System Requirements)
|
| 112 |
schema_app = {
|
|
@@ -129,73 +130,84 @@ def generate_blogger_html(app_query, custom_link, mod_features, theme_color, tel
|
|
| 129 |
}
|
| 130 |
schema_script = f'<script type="application/ld+json">\n[{json.dumps(schema_app)}, {json.dumps(schema_faq)}, {json.dumps(schema_sysreq)}]\n</script>'
|
| 131 |
|
| 132 |
-
theme_background = "#0f172a"
|
| 133 |
-
|
| 134 |
# Final Base HTML Template Construction
|
| 135 |
html_template = f"""
|
| 136 |
{schema_script}
|
|
|
|
| 137 |
<div style="display: none;">
|
| 138 |
<img src="{icon_url}" alt="Download {title} Mod APK" />
|
| 139 |
</div>
|
| 140 |
|
| 141 |
-
<div class="app-post-wrapper" style="background:
|
| 142 |
|
| 143 |
<div style="display: flex; gap: 20px; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 25px; margin-bottom: 25px; flex-wrap: wrap;">
|
| 144 |
-
<img src="{icon_url}" alt="{title} Premium" style="width: 110px; height: 110px; border-radius:
|
| 145 |
<div style="flex: 1; min-width: 250px;">
|
| 146 |
-
<h1 style="margin: 0 0
|
| 147 |
-
<p style="margin: 0 0
|
| 148 |
-
<div style="display: flex; gap:
|
| 149 |
<span><i class="fa-solid fa-star" style="color:#f59e0b;"></i> {rating}</span>
|
| 150 |
<span><i class="fa-solid fa-download" style="color: #38bdf8;"></i> {installs}</span>
|
| 151 |
-
<span><i class="fa-brands fa-android"></i> Android 9.0+</span>
|
| 152 |
</div>
|
| 153 |
</div>
|
| 154 |
</div>
|
| 155 |
|
| 156 |
-
<div style="text-align: center; margin-bottom: 35px; background: #020617; padding:
|
| 157 |
-
<
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
</div>
|
| 164 |
|
| 165 |
-
<div style="background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.2); padding: 15px; border-radius:
|
| 166 |
-
<strong style="color: #e2e8f0; margin-right: 15px;">Join Lexical Space Community:</strong>
|
| 167 |
-
<a href="{telegram_link}" target="_blank" style="display: inline-block; background: #0088cc; color: white; padding: 8px 20px; border-radius:
|
| 168 |
</div>
|
| 169 |
|
| 170 |
-
<h2 style="border-left:
|
| 171 |
-
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(
|
| 172 |
-
<div><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase;">Developer</span><strong>{developer}</strong></div>
|
| 173 |
-
<div><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase;">Version</span><strong>{version}</strong></div>
|
| 174 |
-
<div><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase;">Updated</span><strong>{updated_date}</strong></div>
|
| 175 |
-
<div><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase;">File Size</span><strong>{final_size}</strong></div>
|
| 176 |
</div>
|
| 177 |
|
| 178 |
{video_html}
|
| 179 |
{screenshots_html}
|
| 180 |
|
| 181 |
-
<h2 style="border-left:
|
| 182 |
-
<div style="background: rgba(16, 185, 129, 0.05); border: 1px solid rgba(16, 185, 129, 0.2); padding:
|
| 183 |
-
<ul style="color: #f1f5f9; line-height:
|
| 184 |
{features_list}
|
| 185 |
</ul>
|
| 186 |
</div>
|
| 187 |
|
| 188 |
-
<h2 style="border-left:
|
| 189 |
-
<div style="color: #cbd5e1; line-height: 1.
|
| 190 |
{full_description}
|
| 191 |
</div>
|
| 192 |
|
| 193 |
-
<div style="margin-top: 40px; padding-top:
|
| 194 |
DMCA: Lexical Space complies with 17 U.S.C. § 512 and the Digital Millennium Copyright Act. All apps are property of their respective owners.
|
| 195 |
</div>
|
| 196 |
</div>
|
| 197 |
"""
|
| 198 |
word_count = str(len(html_template.split()))
|
|
|
|
| 199 |
keyword_density = str(html_template.lower().count(title.lower()[:10]))
|
| 200 |
|
| 201 |
with open("latest_draft.txt", "w", encoding="utf-8") as f:
|
|
|
|
| 89 |
video_url = app_details.get('video', None)
|
| 90 |
|
| 91 |
# Mod Features Formatting
|
| 92 |
+
|
| 93 |
features_list = ""
|
| 94 |
for feature in mod_features.split(','):
|
| 95 |
if feature.strip():
|
| 96 |
+
features_list += f'<li style="margin-bottom: 10px;"><i class="fa-solid fa-check" style="color: {theme_color}; margin-right: 12px; font-size: 1.1rem;"></i> {feature.strip()}</li>\n'
|
| 97 |
|
| 98 |
# Screenshot HTML Generation
|
| 99 |
screenshots_html = ""
|
| 100 |
if screenshots:
|
| 101 |
+
screenshots_html = f'<h2 style="border-left: 5px solid {theme_color}; padding-left: 12px; margin-top: 35px; font-size: 1.4rem;">App Screenshots</h2><div style="display: flex; gap: 15px; overflow-x: auto; padding-bottom: 15px; scroll-snap-type: x mandatory; margin-bottom: 35px;">'
|
| 102 |
for snap in screenshots:
|
| 103 |
+
screenshots_html += f'<img src="{snap}" style="height: 300px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); scroll-snap-align: start; box-shadow: 0 5px 15px rgba(0,0,0,0.3);">'
|
| 104 |
screenshots_html += '</div>'
|
| 105 |
|
| 106 |
# Video HTML Generation
|
| 107 |
video_html = ""
|
| 108 |
if video_url:
|
| 109 |
embed_url = video_url.replace("watch?v=", "embed/")
|
| 110 |
+
video_html = f'<h2 style="border-left: 5px solid {theme_color}; padding-left: 12px; margin-top: 35px; font-size: 1.4rem;">Official Trailer</h2><div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.4); margin-bottom: 35px;"><iframe src="{embed_url}" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" frameborder="0" allowfullscreen></iframe></div>'
|
| 111 |
|
| 112 |
# SEO Schemas (App, FAQ, System Requirements)
|
| 113 |
schema_app = {
|
|
|
|
| 130 |
}
|
| 131 |
schema_script = f'<script type="application/ld+json">\n[{json.dumps(schema_app)}, {json.dumps(schema_faq)}, {json.dumps(schema_sysreq)}]\n</script>'
|
| 132 |
|
|
|
|
|
|
|
| 133 |
# Final Base HTML Template Construction
|
| 134 |
html_template = f"""
|
| 135 |
{schema_script}
|
| 136 |
+
|
| 137 |
<div style="display: none;">
|
| 138 |
<img src="{icon_url}" alt="Download {title} Mod APK" />
|
| 139 |
</div>
|
| 140 |
|
| 141 |
+
<div class="app-post-wrapper" style="background: #0f172a; width: 100%; min-height: 100vh; margin: 0; padding: 40px 5%; box-sizing: border-box; color: #fff; font-family: 'Plus Jakarta Sans', sans-serif;">
|
| 142 |
|
| 143 |
<div style="display: flex; gap: 20px; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 25px; margin-bottom: 25px; flex-wrap: wrap;">
|
| 144 |
+
<img src="{icon_url}" alt="{title} Premium" style="width: 110px; height: 110px; border-radius: 28px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); flex-shrink: 0;">
|
| 145 |
<div style="flex: 1; min-width: 250px;">
|
| 146 |
+
<h1 style="margin: 0 0 10px 0; font-size: 2.3rem; font-weight: 800; line-height: 1.1;">{title} <span style="font-size: 0.85rem; background: {theme_color}; padding: 5px 12px; border-radius: 12px; vertical-align: middle; margin-left: 10px; letter-spacing: 1px;">MOD</span></h1>
|
| 147 |
+
<p style="margin: 0 0 15px 0; color: #94a3b8; font-weight: 600; font-size: 1.05rem;"><i class="fa-solid fa-layer-group"></i> {category} • Max Store Verified</p>
|
| 148 |
+
<div style="display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.95rem; color: #cbd5e1; font-weight: 700;">
|
| 149 |
<span><i class="fa-solid fa-star" style="color:#f59e0b;"></i> {rating}</span>
|
| 150 |
<span><i class="fa-solid fa-download" style="color: #38bdf8;"></i> {installs}</span>
|
| 151 |
+
<span><i class="fa-brands fa-android" style="color: #10b981;"></i> Android 9.0+</span>
|
| 152 |
</div>
|
| 153 |
</div>
|
| 154 |
</div>
|
| 155 |
|
| 156 |
+
<div style="text-align: center; margin-bottom: 35px; background: #020617; padding: 30px 15px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.03);">
|
| 157 |
+
<div style="display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-bottom: 15px;">
|
| 158 |
+
<a href="{custom_link}" target="_blank" rel="nofollow noopener" class="lex-btn" style="flex: 1; min-width: 260px; max-width: 400px; background: {theme_color}; color: #fff; text-decoration: none; padding: 16px 20px; border-radius: 50px; font-weight: 800; font-size: 1.1rem; box-shadow: 0 0 25px {theme_color}80; transition: transform 0.3s ease; box-sizing: border-box;">
|
| 159 |
+
<i class="fa-solid fa-cloud-arrow-down" style="margin-right: 8px;"></i> Secure APK Download
|
| 160 |
+
</a>
|
| 161 |
+
|
| 162 |
+
<a href="https://play.google.com/store/apps/details?id={app_id}" target="_blank" rel="nofollow noopener" style="flex: 1; min-width: 260px; max-width: 400px; background: #10b981; color: #fff; text-decoration: none; padding: 16px 20px; border-radius: 50px; font-weight: 800; font-size: 1.1rem; box-shadow: 0 0 25px rgba(16, 185, 129, 0.4); transition: transform 0.3s ease; box-sizing: border-box;">
|
| 163 |
+
<i class="fa-brands fa-google-play" style="margin-right: 8px;"></i> Get it on Play Store
|
| 164 |
+
</a>
|
| 165 |
+
</div>
|
| 166 |
+
<p style="font-size: 0.85rem; color: #64748b; margin: 0;">
|
| 167 |
+
<i class="fa-solid fa-shield-halved" style="color: #10b981;"></i> Links encrypted. VirusTotal checked.
|
| 168 |
</p>
|
| 169 |
+
|
| 170 |
+
<div style="display: flex; justify-content: center; gap: 20px; margin-top: 20px; font-size: 0.9rem; font-weight: 600;">
|
| 171 |
+
<a href="mailto:admin@lexicalspace.com?subject=Broken Link Report: {title}" style="color: #ef4444; text-decoration: none; transition: 0.2s;"><i class="fa-solid fa-link-slash"></i> Link not working?</a>
|
| 172 |
+
<a href="mailto:admin@lexicalspace.com?subject=App Issue Report: {title}" style="color: #f59e0b; text-decoration: none; transition: 0.2s;"><i class="fa-solid fa-flag"></i> Report Issue</a>
|
| 173 |
+
</div>
|
| 174 |
</div>
|
| 175 |
|
| 176 |
+
<div style="background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.2); padding: 15px; border-radius: 16px; text-align: center; margin-bottom: 35px;">
|
| 177 |
+
<strong style="color: #e2e8f0; margin-right: 15px; font-size: 1.05rem;">Join Lexical Space Community:</strong>
|
| 178 |
+
<a href="{telegram_link}" target="_blank" style="display: inline-block; background: #0088cc; color: white; padding: 8px 20px; border-radius: 25px; text-decoration: none; font-weight: bold; font-size: 0.95rem; transition: 0.2s; margin-top: 10px;">✈️ Telegram</a>
|
| 179 |
</div>
|
| 180 |
|
| 181 |
+
<h2 style="border-left: 5px solid #38bdf8; padding-left: 12px; margin-bottom: 20px; font-size: 1.4rem;">App Information</h2>
|
| 182 |
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 35px; background: rgba(255,255,255,0.02); padding: 20px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); box-shadow: inset 0 0 15px rgba(0,0,0,0.3);">
|
| 183 |
+
<div style="background: rgba(255,255,255,0.03); padding: 15px; border-radius: 10px;"><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px;">Developer</span><strong style="font-size: 1.05rem;">{developer}</strong></div>
|
| 184 |
+
<div style="background: rgba(255,255,255,0.03); padding: 15px; border-radius: 10px;"><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px;">Version</span><strong style="font-size: 1.05rem;">{version}</strong></div>
|
| 185 |
+
<div style="background: rgba(255,255,255,0.03); padding: 15px; border-radius: 10px;"><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px;">Updated</span><strong style="font-size: 1.05rem;">{updated_date}</strong></div>
|
| 186 |
+
<div style="background: rgba(255,255,255,0.03); padding: 15px; border-radius: 10px;"><span style="display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; margin-bottom: 5px;">File Size</span><strong style="font-size: 1.05rem;">{final_size}</strong></div>
|
| 187 |
</div>
|
| 188 |
|
| 189 |
{video_html}
|
| 190 |
{screenshots_html}
|
| 191 |
|
| 192 |
+
<h2 style="border-left: 5px solid {theme_color}; padding-left: 12px; margin-bottom: 20px; font-size: 1.4rem;">Max Store Modifications</h2>
|
| 193 |
+
<div style="background: rgba(16, 185, 129, 0.05); border: 1px solid rgba(16, 185, 129, 0.2); padding: 25px; border-radius: 16px; margin-bottom: 40px; box-shadow: 0 5px 20px rgba(16, 185, 129, 0.1);">
|
| 194 |
+
<ul style="color: #f1f5f9; line-height: 2; list-style-type: none; padding-left: 0; margin: 0; font-weight: 700; font-size: 1.05rem;">
|
| 195 |
{features_list}
|
| 196 |
</ul>
|
| 197 |
</div>
|
| 198 |
|
| 199 |
+
<h2 style="border-left: 5px solid #f59e0b; padding-left: 12px; margin-bottom: 20px; font-size: 1.4rem;">About {title}</h2>
|
| 200 |
+
<div style="color: #cbd5e1; line-height: 1.8; font-size: 1rem; overflow: hidden;">
|
| 201 |
{full_description}
|
| 202 |
</div>
|
| 203 |
|
| 204 |
+
<div style="margin-top: 40px; padding-top: 25px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; color: #64748b; text-align: center;">
|
| 205 |
DMCA: Lexical Space complies with 17 U.S.C. § 512 and the Digital Millennium Copyright Act. All apps are property of their respective owners.
|
| 206 |
</div>
|
| 207 |
</div>
|
| 208 |
"""
|
| 209 |
word_count = str(len(html_template.split()))
|
| 210 |
+
|
| 211 |
keyword_density = str(html_template.lower().count(title.lower()[:10]))
|
| 212 |
|
| 213 |
with open("latest_draft.txt", "w", encoding="utf-8") as f:
|