      (replace-regexp ".*='?" "")
      (replace-regexp "'.*" "")
      (buffer-string))))
-
-(defun extract-project-id-from-data (project-name data)
-  (let ((jdata (coerce (json-read-from-string data) 'list)))
-    (number-to-string
-     (assoc-default
-      'id
-      (--first
-       (string-match project-name (assoc-default 'name it))
-       jdata)))))
 
 (defun call-pivotal-api (type route handler &optional params)
   (let (pivotal-api-result)

                          (assoc-default 'general_problem jdata))))))
    pivotal-api-result))

(defun get-project-id (project)
  (call-pivotal-api
   "GET"
   "projects"
   (lambda (data)
     (extract-project-id-from-data project data))))

(defun extract-stories (data)
  (coerce
   (assoc-default 'stories
                  (assoc-default 'stories
                                 (json-read-from-string data)))
   'list))

(defun extract-names-from-stories (stories)
  (--map (assoc-default 'name it)
         stories))

(defun extract-ids-from-stories (stories)
  (--map (assoc-default 'id it)
         stories))

(defun search-for-stories (project search-query)
  (let (stories

  (erase-buffer)
  (insert (format "%s" data))
  (pop-to-buffer (current-buffer))))

(defun update-pivotal-story (project name params)
  (let ((story-id (get-or-create-story-id project name)))
