Browse code

Merged 'web/' with 'src/'

Jaidyn Lev authored on 2018-06-14 18:26:00
Showing 4 changed files
1 1
old mode 100644
2 2
new mode 100755
... ...
@@ -3,7 +3,9 @@
3 3
   (:export
4 4
     :increment-visitors
5 5
     :fetch-visitors
6
-    :create-entry))
6
+    :create-entry
7 7
 
8
+    :init
9
+    :dm-txt))
8 10
 
9 11
 (in-package :doormat)
10 12
new file mode 100755
... ...
@@ -0,0 +1,24 @@
1
+(defun init ()
2
+  "Init function for use directly in CGI scripts."
3
+
4
+  (let ((*standard-output* (make-broadcast-stream)))
5
+    (load "/var/lighttpd/.sbclrc"))
6
+  (let ((*standard-output* (make-broadcast-stream)))
7
+    (ql:quickload "doormat"))
8
+
9
+  (cl-cgi:populate-environment))
10
+
11
+;;(format t "Content-Type: text/html~%~%")
12
+
13
+
14
+(defun dm-txt ()
15
+  "Prints out/creates visitor-count for the requested URL."
16
+
17
+  (let ((visitors (doormat:fetch-visitors cl-cgi:*query-string*)))
18
+    (if visitors
19
+      (doormat:increment-visitors cl-cgi:*query-string*)
20
+      (doormat:create-entry cl-cgi:*query-string*))
21
+  
22
+    (if visitors
23
+      (format t "~A" visitors)
24
+      (format t "1"))))
0 25
deleted file mode 100755
... ...
@@ -1,12 +0,0 @@
1
-(format t "Content-Type: text/html~%~%")
2
-
3
-(load "init.lisp")
4
-
5
-(let ((visitors (doormat:fetch-visitors cl-cgi:*query-string*)))
6
-  (if visitors
7
-    (doormat:increment-visitors cl-cgi:*query-string*)
8
-    (doormat:create-entry cl-cgi:*query-string*))
9
-  
10
-  (if visitors
11
-    (format t "~A" visitors)
12
-    (format t "1")))
13 0
deleted file mode 100755
... ...
@@ -1,7 +0,0 @@
1
-
2
-(let ((*standard-output* (make-broadcast-stream)))
3
-  (load "/var/lighttpd/.sbclrc"))
4
-(let ((*standard-output* (make-broadcast-stream)))
5
-  (ql:quickload "doormat"))
6
-
7
-(cl-cgi:populate-environment)