Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified internal/create-buggy-pr.sh
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
PORT = 3000


def convert_celsius_to_fahrenheit(celsius):
return (celsius * 9/5) + 32


@app.route('/api/weather-activity', methods=['GET'])
def weather_activity():
"""Get location from IP, weather, and activity recommendations"""
Expand All @@ -29,6 +33,8 @@ def weather_activity():
weather_response.raise_for_status()
weather = weather_response.json()['current_weather']

weather['temperature'] = convert_celsius_to_fahrenheit(weather['temperature'])

# Business logic: Recommend activity based on weather
recommended_activity = 'Play a board game'
if weather['temperature'] > 40:
Expand Down