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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
*** To test in the repl
1. clone this repo and granolin into your =~/quicklisp/local-projects= directory. For example:
#+BEGIN_SRC bash
cd ~/quicklisp/local-projects
git clone https://github.com/cbeo/posterbot posterbot
git clone https://github.com/cbeo/granolin granolin
cd granolin
git checkout origin/develop
#+END_SRC
2. fire up lisp and load the posterbot system, make a new instance, log in, and start
#+BEGIN_SRC lisp
(ql:quickload :posterbot)
(in-package :posterbot)
(let ((bot (make-instance 'posterbot
:ssl nil
:user-id "mybotaccount"
:homeserver "localhost:8008")))
(login bot "mybotaccount" "mypassword")
(start bot))
#+END_SRC
3. Invite the bot to a room, it should automatically accept your invitation.
4. Post a link to an image. The link should end in one of =.gif=, =.jpg=, =.bmp=, =.jpeg=, or =.png=.
*** To build a "stand alone" bot
1. Get posterbot and granolin into a place where quicklisp can find them, as in 1 above.
2. from a terminal (not from emacs and slime) fire up SBCL, and do the following:
#+BEGIN_SRC lisp
(ql:quickload :posterbot)
(in-package :posterbot)
(sb-ext:save-lisp-and-die #p"posterbot"
:toplevel #'start-posterbot
:executable t
:compression t)
#+END_SRC
3. Make a =posterbot.config= file. The following is an example:
#+BEGIN_SRC
(:ssl nil ;; in the case of a loca testing server, the default is t
:hardcopy "posterbot.hardcopy" ;; for recovering sessions, this file will be created
:user-id "posterbot" ;; the user you have already created on your server for the bot
:password "XXXXXXXX"
:homeserver "localhost:8008" ;; or your real one
)
#+END_SRC
4. Then, from the same directory that the config file is in, just do
#+BEGIN_SRC bash
./posterbot
#+END_SRC
|