File size: 9,597 Bytes
99966a2 e2fc4ea cd56956 99966a2 e2fc4ea 99966a2 e2fc4ea cd56956 99966a2 e2fc4ea 99966a2 e2fc4ea cd56956 99966a2 e2fc4ea 99966a2 e2fc4ea 99966a2 e2fc4ea 99966a2 e2fc4ea 99966a2 cd56956 99966a2 | 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 | import gradio as gr
import json
from datetime import datetime
# Sample data for the blog entries
blog_entries = [
{
"id": 1,
"title": "Talk to your AI like a 'bro'",
"content": "Because talking like a 'bro' to ya ai make yo ai tawk likka bro",
"date": "2025-07-01",
"category": "Romance & Relationships"
},
{
"id": 2,
"title": "Have AI Explain Quantum Physics Using Only Emojis",
"content": "π¬βοΈπ€ = π§ π₯. Challenge your AI to break down the most complex scientific concepts using nothing but tiny pictures. Results may vary from enlightening to completely incomprehensible.",
"date": "2025-07-02",
"category": "Science & Education"
},
{
"id": 3,
"title": "Ask AI to bust a dad joke about itself",
"content": "Ask your ai to bust a dad joke about itself, because, why not?",
"date": "2025-07-03",
"category": "Fashion & Style"
},
{
"id": 4,
"title": "Have AI Write a Serious Business Email About Your Pet's Demands",
"content": "Transform your cat's 3 AM zoomies into a professional complaint letter. Your AI secretary will help draft the most formal correspondence about treats and belly rubs.",
"date": "2025-07-04",
"category": "Pets & Animals"
},
{
"id": 5,
"title": "Insult AI when it get 'how many r's are in strawberry' wrong",
"content": "Because it is a good way to let out some anger on something without feelings",
"date": "2025-06-30",
"category": "Health & Fitness"
},
{
"id": 6,
"title": "Have AI Write a Yelp Review for Your Own House",
"content": "Rate your living space like a disappointed customer. '2 stars - bathroom has no room service, kitchen staff (me) is terrible, would not recommend.'",
"date": "2025-06-29",
"category": "Home & Living"
},
{
"id": 7,
"title": "Ask AI to Translate Your Grocery List into Shakespearean English",
"content": "Transform mundane shopping into an epic quest. 'Wherefore art thou, organic kale?' becomes the battle cry of your noble supermarket adventure.",
"date": "2025-06-28",
"category": "Food & Cooking"
},
{
"id": 8,
"title": "Have AI Create a LinkedIn Profile for Your Favorite Fictional Character",
"content": "Help Sherlock Holmes network professionally or give Batman the corporate presence he deserves. Watch AI struggle with employment gaps and unconventional work experiences.",
"date": "2025-06-27",
"category": "Career & Professional"
},
{
"id": 9,
"title": "Get AI to write a Sherlock Holmes style story about all the toilet paper finishing",
"content": "Toilet paper finishing is a serious business, and serious business is what Sherlock Holmes is all about",
"date": "2025-07-05",
"category": "Missing TP & Sherlock Holmes"
}
]
def create_blog_entry_html(entry):
"""Create HTML for a single blog entry"""
return f"""
<div style="border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin: 10px 0; background: white;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
<h3 style="margin: 0; color: #2c3e50;">#{entry['id']}: {entry['title']}</h3>
<span style="background: #3498db; color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px;">
{entry['category']}
</span>
</div>
<p style="color: #666; margin: 10px 0; line-height: 1.6;">{entry['content']}</p>
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 15px;">
<div style="color: #999; font-size: 12px;">
π
{entry['date']}
</div>
<a href="https://huggingface.co/spaces/ReallyFloppyPenguin/AstonishingSuperIntel"
target="_blank"
style="background: #ff6b6b; color: white; padding: 8px 16px; border-radius: 6px; text-decoration: none; font-size: 14px; font-weight: bold; transition: background-color 0.3s;">
π Try it here
</a>
</div>
</div>
"""
def get_all_entries():
"""Return all blog entries as HTML"""
html_content = """
<div style="max-width: 800px; margin: 0 auto; padding: 20px;">
<div style="text-align: center; margin-bottom: 30px;">
<h1 style="color: #2c3e50; margin-bottom: 10px;">π§ 101 Dumb And Stupid Things To Do With An AI π€</h1>
<p style="color: #666; font-size: 16px;">A collection of hilariously pointless AI experiments for your entertainment</p>
<p style="color: #999; font-size: 14px;">Total entries: {}/101</p>
</div>
""".format(len(blog_entries))
# Sort entries by ID (newest first)
sorted_entries = sorted(blog_entries, key=lambda x: x['id'], reverse=True)
for entry in sorted_entries:
html_content += create_blog_entry_html(entry)
html_content += "</div>"
return html_content
def filter_by_category(category):
"""Filter entries by category"""
if category == "All Categories":
return get_all_entries()
filtered_entries = [entry for entry in blog_entries if entry['category'] == category]
html_content = f"""
<div style="max-width: 800px; margin: 0 auto; padding: 20px;">
<div style="text-align: center; margin-bottom: 30px;">
<h1 style="color: #2c3e50; margin-bottom: 10px;">π§ 101 Dumb And Stupid Things To Do With An AI π€</h1>
<p style="color: #666; font-size: 16px;">Category: {category}</p>
<p style="color: #999; font-size: 14px;">Showing {len(filtered_entries)} entries</p>
</div>
"""
sorted_entries = sorted(filtered_entries, key=lambda x: x['id'], reverse=True)
for entry in sorted_entries:
html_content += create_blog_entry_html(entry)
html_content += "</div>"
return html_content
def search_entries(query):
"""Search entries by title or content"""
if not query.strip():
return get_all_entries()
query_lower = query.lower()
filtered_entries = [
entry for entry in blog_entries
if query_lower in entry['title'].lower() or query_lower in entry['content'].lower()
]
html_content = f"""
<div style="max-width: 800px; margin: 0 auto; padding: 20px;">
<div style="text-align: center; margin-bottom: 30px;">
<h1 style="color: #2c3e50; margin-bottom: 10px;">π§ 101 Dumb And Stupid Things To Do With An AI π€</h1>
<p style="color: #666; font-size: 16px;">Search results for: "{query}"</p>
<p style="color: #999; font-size: 14px;">Found {len(filtered_entries)} entries</p>
</div>
"""
if not filtered_entries:
html_content += """
<div style="text-align: center; padding: 40px; color: #666;">
<h3>No entries found π
</h3>
<p>Try searching for something else or browse all categories!</p>
</div>
"""
else:
sorted_entries = sorted(filtered_entries, key=lambda x: x['id'], reverse=True)
for entry in sorted_entries:
html_content += create_blog_entry_html(entry)
html_content += "</div>"
return html_content
# Get unique categories for the dropdown
categories = ["All Categories"] + sorted(list(set(entry['category'] for entry in blog_entries)))
# Create the Gradio interface
with gr.Blocks(title="101 Dumb And Stupid Things To Do With An AI", theme=gr.themes.Soft()) as demo:
gr.HTML("""
<div style="text-align: center; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; margin-bottom: 20px;">
<h1 style="margin: 0; font-size: 2.5em;">π§ ReallyFloppyPenguin's AI Shenanigans π€</h1>
<p style="margin: 10px 0 0 0; font-size: 1.2em;">101 Dumb And Stupid Things To Do With An AI</p>
</div>
""")
with gr.Row():
with gr.Column(scale=1):
category_dropdown = gr.Dropdown(
choices=categories,
value="All Categories",
label="Filter by Category",
interactive=True
)
with gr.Column(scale=2):
search_box = gr.Textbox(
placeholder="Search entries...",
label="Search",
interactive=True
)
with gr.Column(scale=1):
search_btn = gr.Button("Search", variant="primary")
blog_display = gr.HTML(value=get_all_entries())
# Event handlers
category_dropdown.change(
fn=filter_by_category,
inputs=[category_dropdown],
outputs=[blog_display]
)
search_btn.click(
fn=search_entries,
inputs=[search_box],
outputs=[blog_display]
)
search_box.submit(
fn=search_entries,
inputs=[search_box],
outputs=[blog_display]
)
gr.HTML("""
<div style="text-align: center; padding: 20px; margin-top: 30px; color: #666; border-top: 1px solid #eee;">
<p>π More ridiculous AI experiments coming soon! Currently at {}/101 entries.</p>
<p>Have a dumb AI idea? Share it in the discussions!</p>
</div>
""".format(len(blog_entries)))
if __name__ == "__main__":
demo.launch() |