Created
May 17, 2016 21:06
-
-
Save tormaroe/8c5a346a879bda3174b879d566fc582d to your computer and use it in GitHub Desktop.
Fantasy Premiere League fetch players
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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