summaryrefslogtreecommitdiff
path: root/steam.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'steam.lisp')
-rw-r--r--steam.lisp22
1 files changed, 22 insertions, 0 deletions
diff --git a/steam.lisp b/steam.lisp
new file mode 100644
index 0000000..5828b22
--- /dev/null
+++ b/steam.lisp
@@ -0,0 +1,22 @@
+(defvar steam-host "api.steampowered.com")
+
+(defun set-steam-key (key)
+ (setf (steam-key *config*) key))
+
+(defun set-steam-id (id)
+ (setf (steam-user-id *config*) id))
+
+(defun steam-query-key ()
+ (format nil "key=~a" (steam-key *config*)))
+
+(defun steam-query-user ()
+ (format nil "steamid=~a" (steam-user-id *config*)))
+
+(defun steam-games-uri ()
+ (quri:make-uri-http
+ :host steam-host
+ :path "IPlayerService/GetOwnedGames/v0001/"
+ :query (format nil "~a&~a" (steam-query-key) (steam-query-user))))
+
+(defun steam-games ()
+ (drakma:http-request (quri:render-uri (steam-games-uri))))