tangled
alpha
login
or
join now
m1emi1em.dev
/
bb-scripts
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
display results: use format, swap arg order
m1emi1em.dev
1 year ago
58be3775
a5f29bd6
+5
-8
1 changed file
expand all
collapse all
unified
split
weather
weather.bb
+5
-8
weather/weather.bb
reviewed
···
53
53
(-> path slurp str/trim-newline))))
54
54
55
55
(defn display-results
56
56
-
[{city :place_name state :state_code}
57
57
-
[[_ temperature] [_ forecast]]]
58
58
-
(doseq [line [""
59
59
-
(str "The weather in " city ", " state " is:")
60
60
-
(str temperature " F")
61
61
-
(str "Forecast: " forecast)]]
62
62
-
(println line)))
56
56
+
[[[_ temperature] [_ forecast]]
57
57
+
{city :place_name state :state_code}]
58
58
+
(print (format "\nThe weather in %s, %s is:\n%d F\nForecast: %s\n"
59
59
+
city state temperature forecast)))
63
60
64
61
(defn get-weather [postal-code]
65
62
(let [{latitude :latitude longitude :longitude :as location} (geocode postal-code)]
···
73
70
first
74
71
(get-all ["temperature" "shortForecast"])
75
72
76
76
-
(#(display-results location %)))))
73
73
+
(display-results location))))
77
74
78
75
(defn -main
79
76
([]