Advertisement
Guest User

Untitled

a guest
Jul 26th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 1.39 KB | None | 0 0
  1.     (let ([name (string-append (hash-ref current-weather 'name))]
  2.           [country (hash-ref (hash-ref current-weather 'sys) 'country)]
  3.           [temp (number->string (exact-round (hash-ref (hash-ref current-weather 'main) 'temp)))]
  4.           [temp-min (number->string (exact-round (hash-ref (hash-ref current-weather 'main) 'temp_min)))]
  5.           [temp-max (number->string (exact-round (hash-ref (hash-ref current-weather 'main) 'temp_max)))]
  6.           [humidity (number->string (hash-ref (hash-ref current-weather 'main) 'humidity))]
  7.           [wind (number->string (hash-ref (hash-ref current-weather 'wind) 'speed))]
  8.           [description (hash-ref (car (hash-ref current-weather 'weather)) 'description)])
  9.       (irc-send-message! conn
  10.                          recipient
  11.                          (if (not (hash-has-key? current-weather 'name))
  12.                            "Location not found."
  13.                            (string-append name ", "
  14.                                           country " | "
  15.                                           "Temperature: " temp "C ("
  16.                                           temp-min "C - "
  17.                                           temp-max"C) "
  18.                                           "Humidity: " humidity "% "
  19.                                           "Wind: " wind "m/s "
  20.                                           "Conditions: " description))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement