-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.lisp
61 lines (56 loc) · 1.96 KB
/
run.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;;
;; Copyright 2016 Drew Thoreson
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation, version 2 of the
;; License.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, see <http://www.gnu.org/licenses/>.
;;
(ql:quickload "cl-date-time-parser")
(ql:quickload "cl-json")
(ql:quickload "cxml")
(ql:quickload "drakma")
(ql:quickload "hunchentoot")
(ql:quickload "postmodern")
(ql:quickload "puri")
(ql:quickload "simple-date")
(ql:quickload "sanitize")
(ql:quickload "split-sequence")
;; Configure Drakma to use a proxy if the http_proxy environment variable is
;; set. Unfortunately Drakma only supports HTTP proxies, so in order to use a
;; SOCKS proxy (e.g. Tor) it is necessary to tunnel through an HTTP proxy first
;; (e.g. Privoxy).
(let ((proxy (sb-ext:posix-getenv "http_proxy")))
(when proxy
(let ((uri (puri:parse-uri proxy)))
(if (and (puri:uri-scheme uri)
(not (eql (puri:uri-scheme uri) :HTTP)))
(warn (format nil "Ignoring proxy: ~a; only HTTP proxies are supported" proxy))
(setf drakma:*default-http-proxy*
(if (puri:uri-port uri)
(list (puri:uri-host uri)
(puri:uri-port uri))
(puri:uri-host uri)))))))
(load "package.lisp")
(load "config.lisp")
(load "feed-store.lisp")
(load "feed-source.lisp")
(load "feed-parser.lisp")
(load "curator.lisp")
(load "controller.lisp")
(load "scheduler.lisp")
(load "http-server.lisp")
; Load plugins
(loop for f in (directory "plugins/*.lisp") do
(load f))
(feed-store:initialize)
(scheduler:schedule-all)
(http-server:start)