Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -146,72 +146,6 @@ def fetch_local_events():
|
|
146 |
else:
|
147 |
return "<p>Failed to fetch local events</p>"
|
148 |
|
149 |
-
# def fetch_local_weather():
|
150 |
-
# try:
|
151 |
-
# api_key = os.environ['WEATHER_API']
|
152 |
-
# url = f'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/omaha?unitGroup=metric&include=events%2Calerts%2Chours%2Cdays%2Ccurrent&key={api_key}'
|
153 |
-
# response = requests.get(url)
|
154 |
-
# response.raise_for_status()
|
155 |
-
# jsonData = response.json()
|
156 |
-
|
157 |
-
# current_conditions = jsonData.get("currentConditions", {})
|
158 |
-
# temp_celsius = current_conditions.get("temp", "N/A")
|
159 |
-
# if temp_celsius != "N/A":
|
160 |
-
# temp_fahrenheit = (temp_celsius * 9/5) + 32
|
161 |
-
# else:
|
162 |
-
# temp_fahrenheit = "N/A"
|
163 |
-
# condition = current_conditions.get("conditions", "N/A")
|
164 |
-
# humidity = current_conditions.get("humidity", "N/A")
|
165 |
-
|
166 |
-
# weather_html = f"""
|
167 |
-
# <div class="weather-theme">
|
168 |
-
# <h2 style="font-family: 'Georgia', serif; color: #4CAF50; background-color: #f8f8f8; padding: 10px; border-radius: 10px;">Local Weather</h2>
|
169 |
-
# <div class="weather-content">
|
170 |
-
# <div class="weather-icon">
|
171 |
-
# <img src="https://www.weatherbit.io/static/img/icons/{get_weather_icon(condition)}.png" alt="{condition}" style="width: 100px; height: 100px;">
|
172 |
-
# </div>
|
173 |
-
# <div class="weather-details">
|
174 |
-
# <p style="font-family: 'Verdana', sans-serif; color: #333; font-size: 1.2em;">Temperature: {temp_fahrenheit}°F</p>
|
175 |
-
# <p style="font-family: 'Verdana', sans-serif; color: #333; font-size: 1.2em;">Condition: {condition}</p>
|
176 |
-
# <p style="font-family: 'Verdana', sans-serif; color: #333; font-size: 1.2em;">Humidity: {humidity}%</p>
|
177 |
-
# </div>
|
178 |
-
# </div>
|
179 |
-
# </div>
|
180 |
-
# <style>
|
181 |
-
# .weather-theme {{
|
182 |
-
# animation: backgroundAnimation 10s infinite alternate;
|
183 |
-
# border: 1px solid #ddd;
|
184 |
-
# border-radius: 10px;
|
185 |
-
# padding: 10px;
|
186 |
-
# margin-bottom: 15px;
|
187 |
-
# background: linear-gradient(45deg, #ffcc33, #ff6666, #ffcc33, #ff6666);
|
188 |
-
# background-size: 400% 400%;
|
189 |
-
# box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
190 |
-
# transition: box-shadow 0.3s ease, background-color 0.3s ease;
|
191 |
-
# }}
|
192 |
-
# .weather-theme:hover {{
|
193 |
-
# box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
|
194 |
-
# background-position: 100% 100%;
|
195 |
-
# }}
|
196 |
-
# @keyframes backgroundAnimation {{
|
197 |
-
# 0% {{ background-position: 0% 50%; }}
|
198 |
-
# 100% {{ background-position: 100% 50%; }}
|
199 |
-
# }}
|
200 |
-
# .weather-content {{
|
201 |
-
# display: flex;
|
202 |
-
# align-items: center;
|
203 |
-
# }}
|
204 |
-
# .weather-icon {{
|
205 |
-
# flex: 1;
|
206 |
-
# }}
|
207 |
-
# .weather-details {{
|
208 |
-
# flex: 3;
|
209 |
-
# }}
|
210 |
-
# </style>
|
211 |
-
# """
|
212 |
-
# return weather_html
|
213 |
-
# except requests.exceptions.RequestException as e:
|
214 |
-
# return f"<p>Failed to fetch local weather: {e}</p>"
|
215 |
def fetch_local_weather():
|
216 |
try:
|
217 |
api_key = os.environ['WEATHER_API']
|
@@ -624,7 +558,8 @@ def generate_image(prompt):
|
|
624 |
# Hardcoded prompt for image generation
|
625 |
# hardcoded_prompt_1 = "Useing The top events like 'Summer Art Festival'and Date - 06/19/2024 ,Weather-Sunny Bright Day.Create Highly Visually Compelling High Resolution and High Quality Photographics Advatizement for 'Toyota'"
|
626 |
hardcoded_prompt_1="Give a high quality photograph of a great looking red 2026 toyota coupe against a skyline setting in th night, michael mann style in omaha enticing the consumer to buy this product"
|
627 |
-
hardcoded_prompt_2 = "Create a vibrant poster of Nebraska with beautiful weather, featuring picturesque landscapes, clear skies, and the word 'Nebraska' prominently displayed."
|
|
|
628 |
hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large stage with vibrant lights, colorful lasers, a lively dancing crowd, and various electronic equipment in the background."
|
629 |
|
630 |
|
|
|
146 |
else:
|
147 |
return "<p>Failed to fetch local events</p>"
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
def fetch_local_weather():
|
150 |
try:
|
151 |
api_key = os.environ['WEATHER_API']
|
|
|
558 |
# Hardcoded prompt for image generation
|
559 |
# hardcoded_prompt_1 = "Useing The top events like 'Summer Art Festival'and Date - 06/19/2024 ,Weather-Sunny Bright Day.Create Highly Visually Compelling High Resolution and High Quality Photographics Advatizement for 'Toyota'"
|
560 |
hardcoded_prompt_1="Give a high quality photograph of a great looking red 2026 toyota coupe against a skyline setting in th night, michael mann style in omaha enticing the consumer to buy this product"
|
561 |
+
# hardcoded_prompt_2 = "Create a vibrant poster of Nebraska with beautiful weather, featuring picturesque landscapes, clear skies, and the word 'Nebraska' prominently displayed."
|
562 |
+
hardcoded_prompt_2="A vibrant and dynamic football game scene in the style of Peter Paul Rubens, showcasing the intense match between Alabama and Nebraska. The players are depicted with the dramatic, muscular physiques and expressive faces typical of Rubens' style. The Alabama team is wearing their iconic crimson and white uniforms, while the Nebraska team is in their classic red and white attire. The scene is filled with action, with players in mid-motion, tackling, running, and catching the ball. The background features a grand stadium filled with cheering fans, banners, and the natural landscape in the distance. The colors are rich and vibrant, with a strong use of light and shadow to create depth and drama. The overall atmosphere captures the intensity and excitement of the game, infused with the grandeur and dynamism characteristic of Rubens' work."
|
563 |
hardcoded_prompt_3 = "Create a high-energy scene of a DJ performing on a large stage with vibrant lights, colorful lasers, a lively dancing crowd, and various electronic equipment in the background."
|
564 |
|
565 |
|