Skip to content

Instantly share code, notes, and snippets.

@tormaroe
Created May 17, 2016 21:06
Show Gist options
  • Save tormaroe/8c5a346a879bda3174b879d566fc582d to your computer and use it in GitHub Desktop.
Save tormaroe/8c5a346a879bda3174b879d566fc582d to your computer and use it in GitHub Desktop.
Fantasy Premiere League fetch players
(defun fetch-and-spit-player (idx)
(let ((path (format nil "C:\\temp\\fpl\\~A.json" idx)))
(with-open-file (fs path :direction :output
:if-exists :overwrite
:if-does-not-exist :create)
(format t "Output: ~A~%" path)
(format fs (flexi-streams:octets-to-string
(drakma:http-request
(format nil "http://fantasy.premierleague.com/web/api/elements/~A/" idx))
:external-format :UTF-8)))))
(loop for n from 1 to 723
do (fetch-and-spit-player n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment