(in-package #:cl-user)
(defpackage #:cl-mpd-runner
(:use #:cl)
(:export #:main))
(in-package #:cl-mpd-runner)
(load #P"test-client.lisp")
(defun content-type (type)
(format t "Content-Type:~a~%~%" type))
(defun setup-mpd-environment (&key (host "localhost") (port "6600"))
(setf (uiop:getenv "MPD_HOST") host
(uiop:getenv "MPD_PORT") port))
;; Excuse the mess.
(defun html-header ()
(format t "
Now Playing - MPD Status
"))
(defun html-footer ()
(format t "
"))
(defun main ()
(setup-mpd-environment :host "10.99.99.2")
(content-type "text/html; charset=utf-8")
(html-header)
(mpd::clos-client)
(html-footer))
;; (format t "~{~a~^~%~}~%" (sb-ext:posix-environ)))
;; (format t "~a~%" (probe-file "/var/www/html/cgi/cl-mpd/"))
;; (format t "~a~%" asdf:*central-registry*)
;; (format t "~a" (sb-unix::posix-getenv "HTTP_USER_AGENT")))