~pepe/andy

e5ef3aa3c637f882331fb9d514e36f1e76467bf7 — Josef Pospíšil 2 years ago 5793ce4 master
Clean up curl init
1 files changed, 5 insertions(+), 4 deletions(-)

M andy/weather.janet
M andy/weather.janet => andy/weather.janet +5 -4
@@ 16,11 16,12 @@

(defn run [place wmp]
  (shriek/global-init)
  (def curl (shriek/init))
  (def b @"")
  (:setopt curl :url (string "api.openweathermap.org/data/2.5/weather?q=" place
                             "&units=metric&appid=" wmp)
           :write-function (fn [buf] (buffer/push b buf)))
  (def curl (-> (shriek/init)
                (:setopt :url (string "api.openweathermap.org/data/2.5/weather?q=" place
                                      "&units=metric&appid=" wmp)
                         :write-function (fn [buf] (buffer/push b buf)))))

  (ev/spawn
    (forever
      (match (protect (-> curl :perform))