<commit_before>(require 'request)
(require 'json)

(setq eric-weather-api nil)

(defun eric-weather (zip)
  "Gets current weather for provided zip code"
  (interactive "sZip: ")
  (if (not (boundp 'eric-weather-api))
    (error "No API key provided.  Set eric-weather-api"))
  (if (not (boundp 'eric-weather-unit))
    (setq eric-weather-unit 'imperial))

  (setq apiUrl 
   (format "http://api.openweathermap.org/data/2.5/weather?zip=%s,us&units=%s&appid=%s" zip eric-weather-unit eric-weather-api)
  )

  (message "URL: %s" apiUrl)

  (request
    apiUrl
   :parser 'json-read
   :success (function*
	   (lambda (&key data &allow-other-keys)
	     (setq description (assoc-default 'description (elt (assoc-default 'weather data) 0)))
	     (setq temp (assoc-default 'temp (assoc-default 'main data)))
	     (setq city (assoc-default 'name data))
	     (message "%s is %s @ %s degrees" city description temp)  
	     )
	   )
  ))

(provide 'eric-weather)<commit_msg>This finally works, thanks to /r/emacs<commit_after>(require 'request)
(require 'json)

(defvar eric-weather-api nil)

(defun eric-weather (zip)
  "Gets current weather for provided zip code"
  (interactive "sZip: ")
  (unless eric-weather-api
    (user-error "No API key provided.  Set eric-weather-api"))
  (let* ((apiUrl
          (format "http://api.openweathermap.org/data/2.5/weather?zip=%s,us&units=imperial&appid=%s" zip eric-weather-api)
	  ))
    (request
     apiUrl
     :parser 'json-read
     :success (function*
               (lambda (&key data &allow-other-keys)
                 (let ((description (assoc-default 'description (elt (assoc-default 'weather data) 0)))
                       (temp (assoc-default 'temp (assoc-default 'main data)))
                       (city (assoc-default 'name data)))
                   (message "%s is %s @ %s degrees" city description temp)))))))

(provide 'eric-weather)
{'fraction_non_alphanumeric': 0.1473851030110935, 'fraction_numerical': 0.003169572107765452, 'mean_word_length': 3.01271186440678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6118557', 'n_tokens_mistral': 681, 'n_tokens_neox': 630, 'n_words': 168}