Browse Source

gulp

master
Michael Murtaugh 5 months ago
commit
ee4f56acf6
75 changed files with 11420 additions and 0 deletions
  1. 9
    0
      LICENSE
  2. 146
    0
      README
  3. 687
    0
      REVISIONS
  4. 2
    0
      conf/infobot-are.txt
  5. 2
    0
      conf/infobot-is.txt
  6. 10
    0
      conf/infobot.channels
  7. 256
    0
      conf/infobot.config
  8. 254
    0
      conf/infobot.config-dist
  9. 2
    0
      conf/infobot.crontab
  10. 13
    0
      conf/infobot.help
  11. 13
    0
      conf/infobot.help-dist
  12. 42
    0
      conf/infobot.users
  13. 42
    0
      conf/infobot.users-dist
  14. 44
    0
      conf/magic8.txt
  15. 6
    0
      conf/sane-are.txt
  16. 3
    0
      conf/sane-ignore.txt
  17. 8
    0
      conf/sane-is.txt
  18. 37
    0
      doc/how_to_fix_files_uploaded_from_windows_to_unix.txt
  19. 652
    0
      doc/infobot_guide.html
  20. 312
    0
      doc/intro.bit
  21. 86
    0
      doc/makemanual.pl
  22. 66
    0
      extras/ANSI.pl
  23. 414
    0
      extras/Aviation.pl
  24. 89
    0
      extras/DNS.pl
  25. 818
    0
      extras/Extras.pl
  26. 144
    0
      extras/Internic.pl
  27. 161
    0
      extras/Math.pl
  28. 136
    0
      extras/NOAA.pl
  29. 89
    0
      extras/RDF.pl
  30. 98
    0
      extras/Slashdot3.pl
  31. 47
    0
      extras/Speller.pl
  32. 67
    0
      extras/Traceroute.pl
  33. 133
    0
      extras/W3Search.pl
  34. 615
    0
      extras/Zippy.pl
  35. 146
    0
      extras/babel.pl
  36. 395
    0
      extras/exchange.pl
  37. 29
    0
      extras/excuse.pl
  38. 48
    0
      extras/insult.pl
  39. 51
    0
      extras/module-template
  40. 63
    0
      extras/myRoutines.pl
  41. 205
    0
      extras/nickometer.pl
  42. 242
    0
      extras/purldoc.pl
  43. 77
    0
      extras/stockquote.pl
  44. 108
    0
      infobot
  45. 36
    0
      scripts/README.scripts
  46. 71
    0
      scripts/curl
  47. 50
    0
      scripts/dump_db
  48. 45
    0
      scripts/flock-test
  49. 18
    0
      scripts/get_entries_from_log
  50. 20
    0
      scripts/make_password
  51. 31
    0
      scripts/make_snap
  52. 45
    0
      scripts/restore_snap
  53. 20
    0
      scripts/run_if_needed.pl
  54. 42
    0
      scripts/track2fact
  55. 91
    0
      scripts/unupdate_dbs
  56. 69
    0
      scripts/update_db
  57. 27
    0
      src/CTCP.pl
  58. 42
    0
      src/Channel.pl
  59. 743
    0
      src/DBM.pl
  60. 60
    0
      src/Help.pl
  61. 475
    0
      src/Irc.pl
  62. 158
    0
      src/IrcExtras.pl
  63. 83
    0
      src/IrcHooks.pl
  64. 166
    0
      src/Misc.pl
  65. 99
    0
      src/Norm.pl
  66. 68
    0
      src/Params.pl
  67. 431
    0
      src/Process.pl
  68. 134
    0
      src/Question.pl
  69. 336
    0
      src/Reply.pl
  70. 89
    0
      src/Search.pl
  71. 159
    0
      src/Setup.pl
  72. 218
    0
      src/Statement.pl
  73. 179
    0
      src/Update.pl
  74. 428
    0
      src/User.pl
  75. 120
    0
      src/Util.pm

+ 9
- 0
LICENSE View File

@@ -0,0 +1,9 @@
1
+
2
+Copyright (c) Kevin Lenzo, 1996-2000, except where noted 
3
+otherwise.  
4
+ 
5
+The Infobot is covered under the same terms as Perl itself 
6
+(the Artistic License).  This software is meant to be freely 
7
+available under those terms in perpetuity.
8
+
9
+

+ 146
- 0
README View File

@@ -0,0 +1,146 @@
1
+
2
+You will need to update your infobot.config 
3
+and infobot.users.  See the example files.
4
+
5
+--
6
+
7
+This requires perl 5.
8
+
9
+You should be able to start up just by running
10
+infobot.  If you are using macperl, you will
11
+(currently) have to make one minor change (because
12
+$^O didn't work for me under os8).
13
+
14
+The infobot uses parameter files, typically in the
15
+params directory, to set up with.  It treats anything
16
+on the command line as a parameter file and tries to 
17
+load it. 
18
+
19
+If you are using macperl, you will want to set 
20
+the value of the macperl parameter to 1 in the
21
+two given param files (in the 'files' dir).
22
+
23
+By default, the infobot uses the IRC setup.  This
24
+may change.  NOTE that the irc version has no output
25
+by default; you'll have to turn up the debug level
26
+to get more.
27
+
28
+to start up the infobot, just invoke it from the 
29
+command line.
30
+
31
+   infobot 
32
+
33
+---
34
+
35
+A note on forms:  you can prepend the tag <reply>
36
+to values in the db to just get a reply with no 
37
+extra info.
38
+
39
+e.g.
40
+
41
+   x => <reply> y
42
+
43
+then when you ask 'x?' it will just reply 'y' instead
44
+of something like "i think x is y".
45
+
46
+---
47
+
48
+* extending the bot by adding your own code
49
+
50
+try to keep your changes inside src/myRoutines.pl
51
+so that you can easily just replace this file when 
52
+there are new revs.  this is called just after some
53
+of the normalization stuff in urlProcess.pl. take
54
+a look at the file for details.
55
+
56
+basically, if myRoutines returns non-null, it's
57
+taken to have 'caught' the event.  you can just
58
+return '' to let the rest of the processing go at
59
+it.
60
+
61
+---
62
+
63
+* update_db & dump_db
64
+
65
+update_db is a little perl script that will take a
66
+flat ascii file and make an infobot-style db out
67
+of it (currently just a couple of dbm files). You'll
68
+want to make 2, even if theye contain only 1 element
69
+each.  it will also simply add (and overwrite entries
70
+in) existing dbs.  This is especially nice if
71
+you don't allow updates to the databases through IRC
72
+and just want a collection of permanent factoids.
73
+
74
+update_db <inputfile> <dbname>
75
+
76
+where <inputfile> is an ascii file like (in the case
77
+of an url-style infobot):
78
+
79
+infobot => at http://www.cs.cmu.edu/~lenzo/hocus.html
80
+
81
+one key => value per line.  In the current setup,
82
+you need an is-database and an are-database, mainly
83
+for legacy reasons about representing plurality and
84
+being able to give the proper form.  in the infobot-is.txt
85
+file and infobot-are.txt files you have examples.  these
86
+are a fine starting point:
87
+
88
+1.1  update_db infobot-is.txt infobot-is
89
+     update_db infobot-are.txt infobot-are
90
+
91
+2. Now you need to edit infobot to set up your bot.
92
+   Don't forget to set the path to perl properly at
93
+   the top and make it executable.
94
+
95
+3. Then try running infobot.  At present, there's a
96
+   bunch of VERY BAD code in it, so don't use the -w
97
+   switch unless you want to fix a bunch of things and
98
+   mail me.
99
+
100
+Eventually, kill it and then you'll probably
101
+want to crontab it.  included is a sample crontab
102
+and the script that you will need to edit.
103
+
104
+dump_db <dbname> 
105
+
106
+will just make a flat ascii file out of the named db,
107
+e.g.
108
+
109
+   dump_db infobot-is
110
+
111
+Both update_db and dump_db take an optional switch, -m, which tells them
112
+what DBM module to use.  You'll need to specify this if you set
113
+DBMModule in your config file in order to get the bot to use something
114
+other than Perl's default.  Eg,
115
+
116
+   update_db -m DB_File infobot-is.txt infobot-is
117
+   dump_db   -m DB_File infobot-is
118
+
119
+good luck, and mail me!
120
+
121
+kevin
122
+lenzo@cs.cmu.edu
123
+
124
+ps - i am just releasing this _now_ instead of waiting
125
+     to fix everything.  If you use this and like it,
126
+     or even if you don't, please mail me!
127
+
128
+---
129
+
130
+thanks to:
131
+
132
+You, for getting this and using this.  Especially if
133
+you mail me and let me put you on the mailing list.
134
+lenzo@cs.cmu.edu
135
+
136
+special thanks to:
137
+
138
+steve orens (sorens) for being a tour-de-force beta bomber
139
+yo for working with script.  this is a big one!
140
+amug and everyone there for hosting the undernet url
141
+#macintosh for dealing with url through his troubled childhood
142
+tris for being an early guinea pig
143
+jadin for pointing out the @verb bug... fixed in 0.17b
144
+chucky burnett for tons of stuff
145
+
146
+

+ 687
- 0
REVISIONS View File

@@ -0,0 +1,687 @@
1
+0.45.3 
2
+
3
+Really fix the stuff in DBM.pl for the %param hash.
4
+
5
+0.45.1,2
6
+
7
+Fixed some path names, made a new tarball.
8
+
9
+0.45.0
10
+
11
+Renamed the miscdir parameter to confdir (in 'infobot')
12
+Renames 'files' directory to 'conf'
13
+Seperated src/ into src/ and extras/
14
+Changed default name to 'i-bot' in the infobot.config file
15
+Rationalized the names of the dbs to use dbname as a prefix
16
+
17
+0.44.5
18
+
19
+Push ./src onto the path so Util.pm gets in.
20
+New Airport.pl replaces METAR2 with a lot nicer stuff.
21
+  mendel++.  Very nice example of a module with forking, 
22
+  etc.
23
+Fixed excuse.pl's return codes.
24
+Roderick++'s extensive factoid locking patches for 
25
+  sharing DBs between infobots.
26
+Added scripts/make_snap and scripts/restore_snap , which
27
+  make and restore ASCII snapshots of the databases, 
28
+  respectively.  This is good to do periodically as a
29
+  backup.
30
+Added stockquote.pl to get stock quotes (LotR++) and added
31
+  a boolean parameter ('stockquotes') to turn it on or off.
32
+Fixed a bug in the http proxy in the RDF fetching code (LotR++)
33
+Messages no longer record the apparent last channel 
34
+  when given in private.
35
+Changed src/excuse.pl to guard against the server being 
36
+  down, though i'm afraid the server is never going
37
+  to come back up.
38
+Cleaned extra white space off the end of parameter values
39
+  during the read of the config file.
40
+Currency exchance is now case-insensetive.
41
+There were several other small bugfixes that didn't make it
42
+  into this file during a move.  
43
+
44
+0.44.4
45
+
46
+Removed 'factpacks' subdirectory.  These packs are all on 
47
+    the web site (http://www.infobot.org), and more.
48
+Tidying of purldoc code.
49
+Tidying of W3Search triggers
50
+Tidying of IMDB, Websters, etc.
51
+Splitting lines in say()/msg()
52
+HTTP proxy support
53
+Little tidying of the Math code.
54
+More informative return values from Process
55
+Better support for `no, $nick, ...' 
56
+Much increased `tell' support
57
+perlfaq' support: uses RSS to get faqtoids from perlfaqprime
58
+Much needed fixes to Zippy factoids
59
+Babelfish rewritten
60
+Net::Telnet timeout fix to insult
61
+Fixed `exchange' typo in infobot.config.
62
+\| for quoting pipes in factoids, Avi++
63
+Added the channels patch. infobot.channels now sets channel-specific 
64
+    options. The format is pretty much the same as the users file.
65
+Documented all the extensions.
66
+Fixed the `eval' command, which you shouldn't be using anyway.
67
+Removed spurious line breaks in Zippy's data.
68
+The `msgonly' parameter, if set, will see a question on channel and
69
+    respond to it via /msg
70
+The `continuity' parameter controls how many seconds must elapse before
71
+    the infobot assumes you have stopped addressing it. Set this to 0,
72
+    and the infobot will never assume that it is being addressed.
73
+Added a warning to Babel.pl if target language is `en'
74
+Close `karma' and `seen' databases in &killed, now karma doesn't
75
+    get reset.
76
+
77
+0.44.3
78
+
79
+NOTE: You must update WWW::Search to the latest version
80
+    for the Google search to work.
81
+NOTE: As usual, the new features (mostly) have new
82
+    parameters that need to be defined in 
83
+    files/infobot.config -- to update, you'll need
84
+    to move your dbm files into the new source
85
+    tree and edit infobot.config.  this is the best way.
86
+Made return values from myRoutines.pl said or messaged
87
+    rather than using &say and &msg inside myRoutines.
88
+    Use 'NOREPLY' to override this if you want to
89
+    use msg and/or say yourself (such as in a callback
90
+    or when forking).
91
+Moved the current myRoutines.pl file to a file called
92
+    Extras.pl.  myRoutines.pl is reserved for local
93
+    user extensions, and Extras.pl is now where the
94
+    add-ons in the distribution are.  They both 
95
+    behave the same as the old myRoutines.pl did.
96
+    Extras is called after myRoutines.
97
+Moved several redirects out of Reply.pl and into Extras.
98
+Added 'literal' query -- 'literal foo' will show the
99
+    factoid for the key foo, with tags and |s literally.
100
+Added RDF/RSS support (LotR++) in RDF.pl.  Uses the tag 
101
+    <rss="http://path/to/rdf/file"> and replaces it in-line.
102
+    RSS is RDF Site Summary; many sites now use this
103
+    standard format to encode their headlines/topics.
104
+    Requires XML::RSS.
105
+Added currency exchange module (exchange.pl) from 
106
+    bobby@bofh.dk (thanks!)
107
+Added excuse module (excuse.pl), also from bobby@bofh.dk!
108
+Added 'purldoc' -- ^Masque++ -- which searches through
109
+    perl FAQ question titles.
110
+Removed usair module. They changed the interface and
111
+    this should just be re-written more gerally.
112
+Added support for Zippy.pl, which provides Zippy witticisms. 
113
+    i made it require to be addressed. "infobot, yow" or 
114
+    "infobot, be zippy" is the trigger.  (mendel++)
115
+    the parameter is "zippy" in infobot.config. 
116
+Added 'divine (.*)', a magic 8-ball (boojum++)
117
+Made Search work again for users with the +s user flag set.
118
+    I still don't recommend this for bots with very big
119
+    dbs.
120
+Another pass at getting the 'reload' code to work (Simon++).
121
+Target adressing in 'tell' made more consistent (Simon++).
122
+Now works with MD5 passwords also (thanks to Bobby Billingsley).
123
+Added timeouts to LWP-using modules.
124
+Fixed CTCP ping reply.
125
+Started RIPE whois to complement Internic whois, moved the
126
+    whois stuff into myRoutines.  This is getting to be 
127
+    a mess and still needs work. (Thanks to Bo Krosgaard for 
128
+    this suggestion).
129
+
130
+0.44.2
131
+
132
+Added USAir flight information: 'usair flight 781'. requires LWP.
133
+    This should be replaced with a more general one.
134
+Added keyed channel patch from Eden Li (tile).
135
+Added new slashdot headline retrieval code care of Richard Hoelscher 
136
+    (Rahga). It makes Chris Tessone's code go to the XML file on /.
137
+    Also restricted its recongized form to "slashdot" or "slashdot 
138
+    headlines". Now called "Slashdot3". 
139
+Added a factpack on Security to factopacks/ submitted by Peter
140
+    Johnson (rottz), and one that has all the ports listed for tcp 
141
+    and udp from Samy Kamkar (CommPort5). Keep it up! :)
142
+Applied a patch to the insult server code from michael@limit.org.
143
+    should fix the function as well as "insult x in german".
144
+    btw, i can't send email to limit.org, so i hope he sees this :)
145
+Modified METAR code from Lazarus Long <lazarus@frontiernet.net>
146
+    and added a status line so it tells the owner it requires
147
+    LWP and Geo::METAR.
148
+Added Simon Cozens' Google search. Requires WWW::Search::Google. 
149
+    "google for foo", "search google for foo". 
150
+Expanded the Google search to do everything WWW::Search knows about,
151
+    and to fork so it wouldn't block the bot. Dejanews, Google,
152
+    Gopher, Excite, Infoseek, HotBot, Lycos, AltaVista, Magellan, 
153
+    PLweb, SFgate, and Verity. try 'search <engine> for <keywords>'.
154
+    But you really need to install WWW::Search to use this.
155
+Added "shut up" (which changes Addressing to "REQUIRE"), 
156
+    "wake up" (changes it to "OPTIONAL"), and "showmode" that
157
+    tells which mode it's in. Aldebaran++ for this. the param
158
+    "shutup" controls whether this is on; turn it off if you always
159
+    want it to be REQUIRE.
160
+Made the output of "seen" nicer; reports how long it's been.
161
+By the way, the Nickometer code is due to Adam Spiers, and it
162
+    was one of the earlier, relatively undocumented add-ons that
163
+    made an example for others to start off with. Added comment.
164
+
165
+
166
+0.44.1
167
+
168
+Fixed the CTCP bug which people were exploiting to crash. Thanks!
169
+Wrapped the babelfish translation code 'use's in evals so
170
+    lack of URI::Escape won't stop you from running the bot.
171
+Added Chris Tessone's slashdot headlines module with a few minor
172
+    changes (the same eval trick as above).
173
+Added some documentation to infobot_guide.html (gasp!)
174
+Added some factpacks in factpacks/ that were on the web site.
175
+
176
+0.44.0
177
+
178
+WARNING: many changes have been undocumented, but 
179
+    i'm getting lots of requests to release the current
180
+    state -- warts and all.  Here it is, 6:35 AM Jun 24 99,
181
+    an hour before yapc 99 opens.
182
+many small things, as usual.
183
+babel code (jdf++) for using babelfish to translate
184
+    things. 'translate to german: hello'. this
185
+    can be shortened to 'x to de hello'.  *note: 
186
+    LWP must be installed for this to work.
187
+'insult server' code; probably not very useful.
188
+    Also requires LWP.
189
+
190
+
191
+0.43.6
192
+
193
+freeside++ for code to clean up the imbd redirect.
194
+fimmtiu++ for 'your' patches. blame him now.
195
+fixed the text of the foldoc redirect (TorgoX++)
196
+added passwords for servers with passwords (ksiero++)
197
+    including server_pass in infobot.config
198
+made s/// case-insensetive (mendel++)
199
+added vhost support and vhost_name to infobot.config (elph++)
200
+changed some trivial status messages to be prettier
201
+made miscdir fully qualified, and changed it to ./files in
202
+    the default infobot.config file.
203
+moved stray help setup code into a subroutine and call it
204
+    from Setup.pl
205
+added "say" for +o (/msg <botname> say #channel foo)
206
+made it so that +o can make the bot join any channel
207
+added NOAA.pl, inspired by geniusj's sh script 
208
+    to myRoutines.pl
209
+added METAR support (mendel++ for metar.pl), and this
210
+    plus the weather routine make nice examples
211
+
212
+0.43.5
213
+
214
+added <action> as a species of <reply>: X is <action> foo!
215
+added murrayb++'s patches for an ignore list file
216
+made help path relative (also murrayb++)
217
+renamed "scripts/make_db" to "scripts/update_db"
218
+added "scripts/unupdate_dbs" to back out all changes by nick
219
+    from a log file or part of a log file. good for removing
220
+    vandalism.
221
+made 'forget' logging more friendly to reversing it
222
+moved all the setup stuff more cleanly into Setup.pl
223
+made the ignore list modifiab;e at run-time with the P flag
224
+    and added 'ignore' and 'unignore' commands via msg
225
+added substitutions: X =~ s/A/B/
226
+
227
+0.43.4
228
+
229
+made private messages not respoken under the persistant
230
+    "seen" -- this was allowing people to get private 
231
+    information on 0.43.3.  0.43.3 was only available for
232
+    a few hours, so i hope this impact is minimal.
233
+
234
+0.43.3
235
+
236
+many undocumented little things.  fixes, of course!
237
+fixed the reply after seen.
238
+made seen persistant.  added the infobot.config line 'seen'
239
+    for the seen-db location
240
+added what the last thing seen was.
241
+made the karma path fully specified.
242
+
243
+0.43.2
244
+
245
+fixed the learning from other bots based on URL policy
246
+
247
+0.43.1
248
+
249
+minor fixes here and there.
250
+fixed the math bug (finally! i think!) 
251
+several NL patches.  Small CTCP fix. 
252
+some statement and question changes.  nothing major.
253
+wanted to get this version out before i tried getting
254
+    things working on a few more platforms.  seems
255
+    pretty stable.
256
+
257
+0.43.0
258
+
259
+* UPDATE YOUR irc.params to infobot.config FILES *
260
+* UPDATE YOUR userfile.txt files to infobot.users FILES *
261
+* SOME DOCUMENTATION is now in doc/infobot_guide.html
262
+
263
+changed DEBUG parameter name to VERBOSITY
264
+removed the broken STANDALONE mode for now
265
+    and eviscerated the code for it
266
+removed some lint from the params file
267
+files/irc.params IS NOW CALLED files/infobot.config
268
+removed vestigial paramdbm code.
269
+removed MacOS-specific code.  this needs-writing.
270
+fixed the "out-loud" comment "you are not a bot owner"
271
+    to be silent
272
+removed the vesitigial and misleading infobot.doc
273
+    and created some documentation ! in doc/infobot.html
274
+    and children
275
+renamed userfile.txt to files/infobot.users
276
+added variable interpolation to infobot.config so
277
+    you can use $ident and all previously-defined
278
+    parameter values in the assignent of subsequent
279
+    paramters.
280
+moved userfile diagnostics into User.pl (!) from 
281
+    top level infobot script
282
+renamed crontab.infobot to infobot.crontab
283
+converted all prints to status() for uniform logging
284
+    and console output
285
+removed other vesitigal logging code (Log.pl)
286
+redid the ansi color by type and status
287
+made internic reply via msg only
288
+removed MLF's -- these need rewriting
289
+moved the addressing code ALL out of Irc*.pl
290
+cleared initial negative on statements when the entry
291
+    doesn't yet exist (less weird factoids)
292
+added 'also |' to add disjuncts easily 
293
+allowed coherent protection of any word from
294
+    processing using \. e.g. \is for
295
+    x \is y is y
296
+added %channels, %seen, %verified hashes
297
+added password + hostmask protection and command-on-request
298
+    with the syntax   /msg <bot> <password> <command>
299
+    where <command> is {eval (mode e), op (mode p), die (mode o)}
300
+previously public bot commands are now private message only or
301
+    privmsg + password
302
+added "sane" files (sane-is.txt amd sane-are.txt) that
303
+    will be loaded into the -is and -are dbs at startup
304
+    and will set some items to sane values.  put things
305
+    that you want to be permanent in these.
306
+isolated statement rejection code
307
+moved math into Math.pl
308
+moved search code into Search.pl
309
+rolled the requires in the top level script into a 
310
+    single loop that automatically loads all the perl
311
+    files in the src directory
312
+fixed the interaction between addressing and volunteering.
313
+    minVolunteerLength applies only if addressing is not REQUIRED
314
+fixed the grotty math bug in perlMath that prevented negative
315
+    numbers from evalling properly
316
+
317
+0.42.1
318
+
319
+made it go for the _first_ verb rather than 
320
+    the first verb in the list.  cleaned up the
321
+    debug info. 
322
+fixed the underscore-erasing bug.
323
+there was a problem is \b$verb\b missing
324
+    things like .is; fixed.
325
+karma fix... allow "me", tolerate whitespace
326
+    (thanks fimmtiu and SirGawain)
327
+
328
+0.42
329
+
330
+fixed an interaction between marked questions,
331
+    minimum volunteering length, and addressing.
332
+allowed talk between friendly bots 
333
+rationalized some of the logging, so you can see
334
+    who did everything ('is also' updates, in
335
+    particular).
336
+fixed the traceroute calling syntax
337
+for some, karma didn't work with 0.41.5; it may now :)
338
+
339
+0.41.5
340
+
341
+closed the traceroute hole
342
+fixed the reverse DNS
343
+fixed some 'huh?' replies -- made sure to return
344
+    the NOREPLY token in Update.pl
345
+* desire: cut confirmation replies (mode)
346
+* desire: silent mode (learn only)
347
+
348
+rev 0.41.0 - 0.41.4
349
+
350
+many minor things, mostly natural language,
351
+    some infrastructure. allowed "forget" to
352
+    end with final punctuation.
353
+added factpack subdirectory.  use these to
354
+    load up the bot with things.  more to come.
355
+fixed "addressing" -> REQUIRE.
356
+
357
+revision 0.41
358
+
359
+added "karma".  now "x++" or "x--" will change x's karma.
360
+    "karma for x" will show it's current standing.  This 
361
+    idea came from dkindred@cs.cmu.edu and his plusplus
362
+    Zephyr bot.  Darrel Kindred is the mastermind here;
363
+    I just liked the idea and added it.
364
+added e mode in userfile to expose eval.  this is not 
365
+    recommended.  requires a crypted pass, then
366
+    /msg bot <pass> eval <perl code>
367
+
368
+revision 0.40.1
369
+
370
+replaced default userfile and fixed a tiny bit of NL where
371
+    it would say "OK" even when X already was Y.
372
+the next rev will be the one for MacPerl etc., i hope. this
373
+    was just a quick fix because 0.40 wasn't letting people
374
+    teach by default.
375
+
376
+revision 0.40
377
+
378
+several small fixes -- fixed a big with article deletion,
379
+    made it so it doesn't echo when told to die by a non-master,
380
+    fixed a few NL things, removed the CTCP die command.
381
+Mailing list opens.
382
+I plan one more rev to make sure this pre-version works
383
+    with MacPerl, then we'll switch to the new model.
384
+
385
+revision 0.39
386
+
387
+integrated wf's changes with my own NL stuff from
388
+    purl exploits.  this is a quick-turnaround rev to
389
+    get things in place for an upcoming major rev.
390
+since nslookup, etc are now keyworded, removed 
391
+    ipmatch and dmatch regexen from their preconditions.
392
+added param for default signoff message
393
+
394
+revision 0.38
395
+
396
+user system reworked flags are settable to limit
397
+    access to the bot's features.  Examples can
398
+    be found in files/userfile.txt.
399
+non-blocking sockets added to allow use of DCC
400
+    and other various functions to come soon.
401
+
402
+revision 0.37
403
+
404
+Standalone mode works again after an oops in the
405
+hooks by wildy... :)
406
+
407
+revision 0.36
408
+
409
+NL stuff, some fixes from purl.
410
+
411
+revision 0.35
412
+
413
+new option;  multiline factoids. you can use the
414
+    following syntax to teach infobot facts on 
415
+    multiple lines:
416
+        <mynick> infobot: something is <multi>
417
+    anything said from there on will be recorded
418
+    as part of the fact.  make sure you designate
419
+    the end of the fact or it will continue adding
420
+    everything you say into the fact.
421
+        <mynick> <end>
422
+    this will end the fact and store it in the db.
423
+    made MLFs work with repeatIgnoreInterval to prevent
424
+        some nasty abuse potential; added status
425
+        line for repeat ignore
426
+
427
+revision 0.34
428
+
429
+fixed the addressing bug found in Irc.pl
430
+removed the "okay" message when it doesn't replace
431
+    a key with the same message; this makes it nicer
432
+    when more than one is on the same channel, though
433
+    they still all reply
434
+changed the default params to make urls optional
435
+fixed the "the" bug, and expanded the "can" grammar
436
+    to handle cases more flexibly.  
437
+undid some bug that were introduced in handing the
438
+    code back and forth
439
+folded in code that got out of sync in parallel revs.
440
+
441
+revision 0.33.3
442
+
443
+added the formatting of public channel messages and
444
+    changed the hook code to be a bit more sane
445
+
446
+revision 0.33.2
447
+
448
+re changed infobot to OPTIONAL listening/learning
449
+    instead of just url's as default
450
+
451
+revision 0.33.1
452
+
453
+added a few irc operator things in param file
454
+fixed the math routines
455
+commented out the dotwise domain thing in Question.pl
456
+    because its regex didn't function correctly, etc
457
+    maybe just use the one nslookup so it doesnt get
458
+    confused with messages.
459
+
460
+cleaned up for a hopefully stable-ish 0.33
461
+
462
+revision 0.32b
463
+
464
+infobot doesn't require perl 5.004 anymore, you
465
+    can run safely with perl 5.001 i'm pretty sure.
466
+added support for ANSI Color -- enjoy, you
467
+    can turn this on/off in the params file. also
468
+    might ansi-fy a few more parts. not much though.
469
+fixed bugs with irc code where infobot
470
+    couldn't join &channels (local) or channels
471
+    with weird things like '!'.
472
+-patrick
473
+
474
+fixed the :) bug
475
+fixed non-default param file to files/irc.params
476
+-kevin
477
+
478
+revision 0.31b
479
+
480
+ok, reintegrating the irc modules.
481
+re-added $nuh support so that users can use their 
482
+    passwords, etc.
483
+made numbers with more than 16 digits "a very big
484
+    number" in the math handling.
485
+it's indentation wars!  now that the tabs are gone,
486
+    most things indent nicely.
487
+cut out a few vestigial lines from the inlet code,
488
+    such as the hard-coded dbs (not used now anyway).
489
+i'm still torn about the copyright/license thing. have 
490
+    to figure out how to handle that.
491
+changed the default nick back the Newbie.
492
+removed the #$%#$% param db that was bugging me so
493
+    much.  just read in the param file and be 
494
+    happy.
495
+renamed "run_infobots.pl" to "run_if_needed.pl" and
496
+    made a couple of minor changes in it.
497
+
498
+
499
+revision 0.30b
500
+
501
+thanks, patrick!  Patrick Cole (wildfire) did 
502
+    everything for rev 029b... many many thanks.
503
+made the irc version the default
504
+changed the default server to cmu
505
+changed the default channel to #infobot
506
+will do more in the near future...
507
+NOTE infobot now requires perl 5.004
508
+
509
+
510
+revision 0.29b
511
+
512
+the first and greatest appearance of the inlet code rolled
513
+    into infobot.   new look makes it easier to see what's
514
+    going on and gives it a greater feel to it.  All irc
515
+    code rewritten by Patrick Cole graciously
516
+added a traceroute command for lazy people, etc
517
+nslookup for domain lookups
518
+reindented all the code by hand (ugh) because it was in an
519
+    "Eight Megs and Constantly Swapping" kind of way :)
520
+infobot can now reconnect split servers ...
521
+    "/ctcp infobot autorecon on"
522
+internic whois querys should work now hopefully
523
+
524
+
525
+revision 0.28b
526
+
527
+the first appearance of "curl", the command-line url.
528
+    useful for one-line queries and updates of the db.
529
+    not as full-featured as the standalone url -- 
530
+    these will probably merge.
531
+fixed a minor bug in writeParamFile
532
+woops.  it was set to userLevel > 100 for the eval 
533
+    instead of >= 100. 
534
+
535
+
536
+revision 0.27b
537
+
538
+aha! there was a bug in the argument parser; used pop 
539
+    instead of shift.  this ought to work better now.
540
+added absolute path to url in in4m.  use this if you're
541
+    going to invoke url from anywhere other than the
542
+    home directory.
543
+cleaned up in4m (top level) somewhat
544
+added mkpasswd and ckpasswd in anticipation of userlevels
545
+added writeParamFile in urlParams.pl.  I still would like
546
+    to get away from the param db and just read and write
547
+    a flat file.
548
+allowed $date, $time variables in values, e.g. "date is $date"
549
+allowed \i \me \my in values that prevents "person-switching",
550
+    e.g. "x is go ahead and tell \me" so it doesn't turn me 
551
+    into "in4m" or whatever on output
552
+moved $safeWho generation into &purifyNick, which makes a
553
+    nick safe to use in a regex (among other things).  it 
554
+    really just removes 'bad' characters.
555
+lifted the 'forget' code above most of the text processing
556
+    so it's more wysiwyf ('what you see is what you forget').
557
+stamped out what i hope is the last nick bracket bug 
558
+lifted the normalize query and switch person calls into urlQuestion
559
+    so that they don't cause weird interaction problems
560
+fixed a bug in 'you' (in switchPerson) referring to the bot
561
+added a 'chomp' on reading init files to keep out extra \n's
562
+added more stuff in urlUser.pl
563
+removed the secretWord potential nightmare and replaced it 
564
+    with the userlist potential nightmare
565
+addusers, readUserFile, writeUserFile, ckuser, users, etc 
566
+    etc. in urlUser.pl
567
+userList parameter in irc.params, standalone.params
568
+userlevel 100 exposes eval (!), userlevel 10 lets you
569
+    override the 'REQUIRE' option for urls.  come to
570
+    think of it, REQUIRE could be a number... 
571
+allowed 'allowUrls' to be a number, in which case it is 
572
+    interpreted as the min userlevel to enter a non-url
573
+
574
+
575
+revision 0.26b
576
+
577
+added a '<reply>' prepended tag to allow simple responses
578
+    (thanks, scuzzi_)
579
+made the default behaviour not to whine about things that
580
+    are already defined (...but x is y...) unless addressed
581
+    which makes it nicer when more than one are on the same
582
+    channel
583
+
584
+
585
+revision 0.25b
586
+
587
+mucked around with run_infobots.pl to get it working with
588
+    cron more obviously
589
+urlProcess had an old-style %params ; changed to %param
590
+moved a check for null paramfile names into loadParams loop
591
+fixed a bracketing error that led to irc mode overriding
592
+made it optional to use the parameter dbm; it's actually
593
+    reasonable to just read the irc.params file only
594
+    and not go for the "persistant parameters"
595
+
596
+
597
+revision 0.24b
598
+
599
+added a "commitDBM every Nth transaction" form of the parameter
600
+made dbm retry 10 times to open if it fails
601
+changed the default standalone params to point to the right files dir
602
+added a 'usage' output to dump_db to match make_db
603
+added param allowLeave, which lets people make the bot leave a chan
604
+changed the top-level name to just in4m.
605
+added args to the command line: -p, -i, -s, -h
606
+added a src/myRoutines.pl file so people can customize easily
607
+
608
+
609
+revision 0.23b
610
+
611
+fixed dump_db :/ silly me
612
+fixed another little problem in urlDBM.pl
613
+
614
+
615
+revision 0.22b
616
+
617
+set up params as a db.  it's still a hack and needs work,
618
+    but it allows for persistant params that you can set
619
+    within a session.
620
+fixed various problems in referring to the right dbs
621
+removed gratuitous accesses to the dbs
622
+exposed more stuff in the standalone version.  see standalone.txt.
623
+set up initialization of dbs within in4m.pl
624
+removed RUN_ME_FIRST
625
+changed %params to %param to make set look nicer
626
+moved make_db and dump_db into scripts/ subdir 
627
+    and cleaned them up slightly
628
+renamed params/ to files/
629
+made a doc dir and put the README for standalone in there
630
+added 'where is x at' form (thanks, scuzzi)
631
+
632
+
633
+revision 0.21b
634
+
635
+got rid of the question count access to the db.
636
+made -w happier.  someday i'll make -s happy too.
637
+added parameter files to make life better.
638
+the first appearance of the standalone desktop interactive 
639
+    version that doesn't depend on irc.
640
+added params and hooks for the standalone version.
641
+params{nick} behaviour made consistant (urlSetup was overriding).
642
+@allowed_channels fixed to $params{'allowed_channels'}.
643
+fixed the if (($params{'addressing'} eq 'REQUIRE') && $addressed)
644
+    to !addressed in urlStatement (thanks again, cburnett).
645
+made it open and close dbm files on each update unless 
646
+    told otherwise. some implementations did not guarantee
647
+    commit.  you can check your implementation and set
648
+    this to null or something else if you have a smart dbm.
649
+added params for maxKeyLength and maxDataLength.
650
+added params and fixed the help files. help files are
651
+    still ugly in the standalone mode.
652
+added allowUpdate parameter so you can have strictly answerbots;
653
+    this will tie in to having restricted lists of users + levels.
654
+made it so by default the irc version has no output.  turn
655
+    up the debug level if you need more insight into what's
656
+    going in.
657
+
658
+
659
+revision 0.20b
660
+
661
+this was a quick rev.
662
+fixed some of the gratuitous named stuff in urlProcess.pl
663
+made it so dns wouldn't try to fork under macperl
664
+got the tracking back up
665
+
666
+
667
+revision 0.19b:
668
+
669
+changed the default db's to be infobot-is and infobot-are
670
+changed RUN_ME_FIRST to deal with that and renamed the .txt files
671
+made a wantNick param
672
+make it so dbs are created if don't exist (as option)
673
+fixed $addressed so it didn't just look for prefixes
674
+fixed a couple of the parameters that weren't referring to the hash
675
+changed $urlCount to $factoidCount
676
+
677
+
678
+revision 0.18b:
679
+
680
+moved a bunch of params into the global hash %params
681
+added &params so people can see the settings 
682
+   e.g. /msg in4m mysecretword &params();
683
+added some parameters up-front for server, port, etc.
684
+changed the bad nickname code 
685
+the burnett fix (:$realname)
686
+added infobot.help as a default help file
687
+

+ 2
- 0
conf/infobot-are.txt View File

@@ -0,0 +1,2 @@
1
+roses => red
2
+violets => blue

+ 2
- 0
conf/infobot-is.txt View File

@@ -0,0 +1,2 @@
1
+oznoid => at mailto:lenzo@cs.cmu.edu or at http://www.cs.cmu.edu/~lenzo
2
+infobot => at http://www.cs.cmu.edu/~infobot

+ 10
- 0
conf/infobot.channels View File

@@ -0,0 +1,10 @@
1
+# Channel File (c) 1999 Infobot & Associates
2
+
3
+ChannelEntry #test {
4
+	fallback   yes;
5
+	addressing REQUIRE;
6
+	shutup	   TRUE;
7
+	msgonly	   TRUE;
8
+	continuity 0;
9
+}
10
+

+ 256
- 0
conf/infobot.config View File

@@ -0,0 +1,256 @@
1
+# parameter settings file for the infobot
2
+# kevin lenzo (lenzo@cs.cmu.edu)
3
+
4
+# note:
5
+#   '$var' means a parameter that has been named; it is interpolated.
6
+#   By convention, things with '.ext' (extensions) are text files, and
7
+#   things with hyphens in them are DBM file prefixes, used for run-time
8
+#   learning or state maintenance.
9
+#
10
+# Nota Bene: Comment out attributes you don't want. Note that the
11
+#            word "false" is actually a true value! use 0 or comment
12
+#            out options you don't want.
13
+
14
+# the internal name for this bot
15
+ident            xpubbot
16
+
17
+# the nickname we want
18
+wantNick         $ident
19
+
20
+# the prefix of the dbm files
21
+dbname           $ident
22
+
23
+# where to put logging info
24
+logfile          $dbname.log
25
+
26
+# plusplus, an idea hijacked from CMU zephyr community,
27
+# and dkindred++ in particular. Otherwise known
28
+# as 'karma'.  this is persistant between shutdowns.
29
+
30
+plusplus         $dbname-karma
31
+
32
+# persistant "seen" db
33
+seen             $dbname-seen
34
+
35
+# do we have an ignore database? uncomment this if not.
36
+ignore           $dbname-ignore
37
+
38
+# should we ALWAYS close and reopen dbm on update?
39
+# some systems don't do commitment until quit.
40
+#
41
+#   0 => never force sync
42
+#   1 => force sync on every update
43
+#   N => force sync every Nth update
44
+
45
+commitDBM        5
46
+
47
+# Explicitly set the database module.  The default is AnyDBM_File.  If
48
+# you want to use any shared database files (via sharedDBMs) you have to
49
+# set this to DB_File.
50
+
51
+#DBMModule	DB_File
52
+
53
+# Specify an extension which should be added to all database names.  By
54
+# default this is empty.
55
+
56
+#DBMExt		.db
57
+
58
+# Specify which databases will be shared among multiple infobots on the
59
+# same machine, and so require locking.  By default none are shared.  If
60
+# you use this at all you have to set DBMModule to DB_File.  This can be
61
+# a list of database names, or /all (which means every database), or
62
+# /all-but-ignore (which means every database except the ignore list).
63
+#
64
+# As of this writing, the databases are:
65
+#
66
+#    is		main database, for singular factoids
67
+#    are	main database, for plural factoids
68
+#    ignore	ignored nicks and user/host patterns
69
+#    plusplus	karma
70
+#    seen	last seen info by each nick
71
+
72
+#sharedDBMs is are plusplus
73
+#sharedDBMs /all
74
+#sharedDBMs /all-but-ignore
75
+
76
+# X is Y
77
+# max length of X (the key, 
78
+#                  the 'left hand side' (LHS) of an assignment, 
79
+#                  or the first argument)
80
+
81
+maxKeySize       50
82
+
83
+
84
+# max length of Y (value or data, the 'right hand side', or 2nd argument)
85
+maxDataSize      400
86
+
87
+# REQUIRE, OPTIONAL, REJECT for different behaviour with URLs
88
+# REQUIRE  means it will need to be a url type (e.g. file:, http:)
89
+# OPTIONAL will take anything
90
+# REJECT   will not accept any urls.  this makes it easy to
91
+#          run 2 with different nicks and styles.
92
+
93
+acceptUrl        OPTIONAL
94
+
95
+# IRC-related params
96
+ircuser          $ident
97
+realname         $ident
98
+# server           irc.infobot.org
99
+server           irc.freenode.net
100
+port             6667
101
+allowed_channels #xpub #infobot #$ident #test
102
+
103
+# channels to join
104
+# use #channel,key (thanks to tile++) for keyed channels
105
+
106
+# join_channels    #infobot #$ident
107
+join_channels    #xpub
108
+
109
+# server password, if needed
110
+# server_pass    myserverpassword
111
+
112
+# vhost support... if you have a vhost, you can use this, 
113
+#                                otherwise it won't work.
114
+#                                inm++, elph++ for this :)
115
+# vhost_name     f00.bar.org
116
+
117
+# nickServ_pass foo
118
+# chanServ_pass bar
119
+
120
+# addressing is when you name the bot.  if this is REQUIRE,
121
+# the bot should only speak when spoken to.  BUT it may listen.
122
+# anything else will mean it can barge in when it thinks it 
123
+# knows something.
124
+# "shutup" determines whether you can switch modes on the
125
+# fly with the bot.  if you use REQUIRE for addressing, you
126
+# probably want to comment out the shutup line.
127
+
128
+addressing       OPTIONAL
129
+# shutup           TRUE
130
+
131
+# ansi screen control is available from 0.32 onwards
132
+# value of 1 means to use ANSI, 0 means generic bold
133
+ansi_control     1
134
+
135
+# things we may or may not want to allow. 1 = allow, 0 otherwise.
136
+# do you want to be a desktop calc?
137
+perlMath         1
138
+fortranMath      0
139
+
140
+# do you want to allow DNS lookup/Internic/Traceroute?
141
+allowDNS         1
142
+allowTraceroute  1
143
+allowInternic    1
144
+
145
+# ord/chr etc
146
+allowConv        1
147
+
148
+# tell so-and-so about such-and-such
149
+allowTelling     1
150
+
151
+# let any old joe update stuff. if this is 0, you'll have to
152
+# either change some code, do everything with e.g. update_db,
153
+# or do something else arcane to get factoids in.
154
+allowUpdate      1
155
+
156
+# How much verbage to display on the console
157
+VERBOSITY        1
158
+
159
+# the magic hack word to unignore everyone
160
+unignoreWord     unignore-everyone
161
+
162
+# where configuration and help files and such live, the default is the
163
+# files subdir of the main directory
164
+confdir          conf
165
+
166
+# my help file.  this will get confdir prepended
167
+# you may want to change this to $ident.help
168
+
169
+helpfile         infobot.help
170
+
171
+srcdir           src
172
+extradir         extras
173
+
174
+# within how long of getting the same reply should
175
+# we not respond (irc mode only).  in seconds.
176
+
177
+repeatIgnoreInterval 8
178
+
179
+# in what contexts do we let people make the bot leave a
180
+# channel (this is an or'd list; public private)
181
+
182
+allowLeave       public
183
+
184
+# our user list default file (in miscdir)
185
+# you may want to change this to $ident.users
186
+
187
+userList         infobot.users
188
+
189
+# channel list, specifies options which differ from the defaults, by
190
+# channel.
191
+
192
+channelList		infobot.channels
193
+
194
+# default quit message
195
+quitMsg          regrouping; bbiab
196
+
197
+
198
+# how long does something have to be before we'll just volunteer
199
+# the answer without a question mark, question, or being addressed
200
+minVolunteerLength 8
201
+
202
+# other bots to ask for help
203
+
204
+# friendlyBots url purl script mrapi
205
+
206
+# sane defines that ALWAYS overwrite existing values at startup
207
+# this is a prefix for the files (sane-is.txt, sane-are.txt)
208
+
209
+sanePrefix sane
210
+
211
+# allow weather and METAR lookups, respectively. These should
212
+# actually be turned into a user modes.  mendel++. Require
213
+# LWP and metar requires Geo::METAR.
214
+weather true
215
+metar   true
216
+
217
+# babelfish translator.  jdf++. requires LWP, not included.
218
+babel   true
219
+
220
+# slashdot headlines. requires LWP, not included. get it from CPAN.
221
+slash   true
222
+
223
+# insult and excuse servers
224
+insult  true
225
+excuse true
226
+
227
+# google search.. simon++ . expanded to www search using several
228
+# engines since it was so easy once you have WWW::Search.
229
+# use "update" if you want it to update the db, or comment
230
+# out if you don't want it. requires WWW::Search, not included.
231
+# use "forceupdate" to force a db update on every google search.
232
+wwwsearch  update
233
+
234
+# general headline-getter. uses RDF. (LotR++)
235
+rss true
236
+
237
+# purldoc perl documentation lookup DMasque++, HJ++
238
+purldoc true
239
+purldoc_trigger purldoc
240
+purldoc_max_public 3
241
+
242
+# speller. requires the ispell program.
243
+ispell true
244
+
245
+#zippy quotes (infobot, yow  or infobot, be zippy)
246
+zippy true
247
+
248
+# the magic 8ball (divine)
249
+magic8_answers $miscdir/magic8.txt
250
+
251
+# exchange rates (exchange 233 DEM to USD)
252
+exchange true
253
+
254
+# stock quotes 
255
+stockquotes true
256
+

+ 254
- 0
conf/infobot.config-dist View File

@@ -0,0 +1,254 @@
1
+# parameter settings file for the infobot
2
+# kevin lenzo (lenzo@cs.cmu.edu)
3
+
4
+# note:
5
+#   '$var' means a parameter that has been named; it is interpolated.
6
+#   By convention, things with '.ext' (extensions) are text files, and
7
+#   things with hyphens in them are DBM file prefixes, used for run-time
8
+#   learning or state maintenance.
9
+#
10
+# Nota Bene: Comment out attributes you don't want. Note that the
11
+#            word "false" is actually a true value! use 0 or comment
12
+#            out options you don't want.
13
+
14
+# the internal name for this bot
15
+ident            i-bot
16
+
17
+# the nickname we want
18
+wantNick         $ident
19
+
20
+# the prefix of the dbm files
21
+dbname           $ident
22
+
23
+# where to put logging info
24
+logfile          $dbname.log
25
+
26
+# plusplus, an idea hijacked from CMU zephyr community,
27
+# and dkindred++ in particular. Otherwise known
28
+# as 'karma'.  this is persistant between shutdowns.
29
+
30
+plusplus         $dbname-karma
31
+
32
+# persistant "seen" db
33
+seen             $dbname-seen
34
+
35
+# do we have an ignore database? uncomment this if not.
36
+ignore           $dbname-ignore
37
+
38
+# should we ALWAYS close and reopen dbm on update?
39
+# some systems don't do commitment until quit.
40
+#
41
+#   0 => never force sync
42
+#   1 => force sync on every update
43
+#   N => force sync every Nth update
44
+
45
+commitDBM        5
46
+
47
+# Explicitly set the database module.  The default is AnyDBM_File.  If
48
+# you want to use any shared database files (via sharedDBMs) you have to
49
+# set this to DB_File.
50
+
51
+#DBMModule	DB_File
52
+
53
+# Specify an extension which should be added to all database names.  By
54
+# default this is empty.
55
+
56
+#DBMExt		.db
57
+
58
+# Specify which databases will be shared among multiple infobots on the
59
+# same machine, and so require locking.  By default none are shared.  If
60
+# you use this at all you have to set DBMModule to DB_File.  This can be
61
+# a list of database names, or /all (which means every database), or
62
+# /all-but-ignore (which means every database except the ignore list).
63
+#
64
+# As of this writing, the databases are:
65
+#
66
+#    is		main database, for singular factoids
67
+#    are	main database, for plural factoids
68
+#    ignore	ignored nicks and user/host patterns
69
+#    plusplus	karma
70
+#    seen	last seen info by each nick
71
+
72
+#sharedDBMs is are plusplus
73
+#sharedDBMs /all
74
+#sharedDBMs /all-but-ignore
75
+
76
+# X is Y
77
+# max length of X (the key, 
78
+#                  the 'left hand side' (LHS) of an assignment, 
79
+#                  or the first argument)
80
+
81
+maxKeySize       50
82
+
83
+
84
+# max length of Y (value or data, the 'right hand side', or 2nd argument)
85
+maxDataSize      400
86
+
87
+# REQUIRE, OPTIONAL, REJECT for different behaviour with URLs
88
+# REQUIRE  means it will need to be a url type (e.g. file:, http:)
89
+# OPTIONAL will take anything
90
+# REJECT   will not accept any urls.  this makes it easy to
91
+#          run 2 with different nicks and styles.
92
+
93
+acceptUrl        OPTIONAL
94
+
95
+# IRC-related params
96
+ircuser          $ident
97
+realname         $ident
98
+server           irc.infobot.org
99
+port             6667
100
+allowed_channels #infobot #$ident #test
101
+
102
+# channels to join
103
+# use #channel,key (thanks to tile++) for keyed channels
104
+
105
+join_channels    #infobot #$ident
106
+
107
+# server password, if needed
108
+# server_pass    myserverpassword
109
+
110
+# vhost support... if you have a vhost, you can use this, 
111
+#                                otherwise it won't work.
112
+#                                inm++, elph++ for this :)
113
+# vhost_name     f00.bar.org
114
+
115
+# nickServ_pass foo
116
+# chanServ_pass bar
117
+
118
+# addressing is when you name the bot.  if this is REQUIRE,
119
+# the bot should only speak when spoken to.  BUT it may listen.
120
+# anything else will mean it can barge in when it thinks it 
121
+# knows something.
122
+# "shutup" determines whether you can switch modes on the
123
+# fly with the bot.  if you use REQUIRE for addressing, you
124
+# probably want to comment out the shutup line.
125
+
126
+addressing       OPTIONAL
127
+# shutup           TRUE
128
+
129
+# ansi screen control is available from 0.32 onwards
130
+# value of 1 means to use ANSI, 0 means generic bold
131
+ansi_control     1
132
+
133
+# things we may or may not want to allow. 1 = allow, 0 otherwise.
134
+# do you want to be a desktop calc?
135
+perlMath         1
136
+fortranMath      0
137
+
138
+# do you want to allow DNS lookup/Internic/Traceroute?
139
+allowDNS         1
140
+allowTraceroute  1
141
+allowInternic    1
142
+
143
+# ord/chr etc
144
+allowConv        1
145
+
146
+# tell so-and-so about such-and-such
147
+allowTelling     1
148
+
149
+# let any old joe update stuff. if this is 0, you'll have to
150
+# either change some code, do everything with e.g. update_db,
151
+# or do something else arcane to get factoids in.
152
+allowUpdate      1
153
+
154
+# How much verbage to display on the console
155
+VERBOSITY        1
156
+
157
+# the magic hack word to unignore everyone
158
+unignoreWord     unignore-everyone
159
+
160
+# where configuration and help files and such live, the default is the
161
+# files subdir of the main directory
162
+confdir          conf
163
+
164
+# my help file.  this will get confdir prepended
165
+# you may want to change this to $ident.help
166
+
167
+helpfile         infobot.help
168
+
169
+srcdir           src
170
+extradir         extras
171
+
172
+# within how long of getting the same reply should
173
+# we not respond (irc mode only).  in seconds.
174
+
175
+repeatIgnoreInterval 8
176
+
177
+# in what contexts do we let people make the bot leave a
178
+# channel (this is an or'd list; public private)
179
+
180
+allowLeave       public
181
+
182
+# our user list default file (in miscdir)
183
+# you may want to change this to $ident.users
184
+
185
+userList         infobot.users
186
+
187
+# channel list, specifies options which differ from the defaults, by
188
+# channel.
189
+
190
+channelList		infobot.channels
191
+
192
+# default quit message
193
+quitMsg          regrouping; bbiab
194
+
195
+
196
+# how long does something have to be before we'll just volunteer
197
+# the answer without a question mark, question, or being addressed
198
+minVolunteerLength 8
199
+
200
+# other bots to ask for help
201
+
202
+# friendlyBots url purl script mrapi
203
+
204
+# sane defines that ALWAYS overwrite existing values at startup
205
+# this is a prefix for the files (sane-is.txt, sane-are.txt)
206
+
207
+sanePrefix sane
208
+
209
+# allow weather and METAR lookups, respectively. These should
210
+# actually be turned into a user modes.  mendel++. Require
211
+# LWP and metar requires Geo::METAR.
212
+weather true
213
+metar   true
214
+
215
+# babelfish translator.  jdf++. requires LWP, not included.
216
+babel   true
217
+
218
+# slashdot headlines. requires LWP, not included. get it from CPAN.
219
+slash   true
220
+
221
+# insult and excuse servers
222
+insult  true
223
+excuse true
224
+
225
+# google search.. simon++ . expanded to www search using several
226
+# engines since it was so easy once you have WWW::Search.
227
+# use "update" if you want it to update the db, or comment
228
+# out if you don't want it. requires WWW::Search, not included.
229
+# use "forceupdate" to force a db update on every google search.
230
+wwwsearch  update
231
+
232
+# general headline-getter. uses RDF. (LotR++)
233
+rss true
234
+
235
+# purldoc perl documentation lookup DMasque++, HJ++
236
+purldoc true
237
+purldoc_trigger purldoc
238
+purldoc_max_public 3
239
+
240
+# speller. requires the ispell program.
241
+ispell true
242
+
243
+#zippy quotes (infobot, yow  or infobot, be zippy)
244
+zippy true
245
+
246
+# the magic 8ball (divine)
247
+magic8_answers $miscdir/magic8.txt
248
+
249
+# exchange rates (exchange 233 DEM to USD)
250
+exchange true
251
+
252
+# stock quotes 
253
+stockquotes true
254
+

+ 2
- 0
conf/infobot.crontab View File

@@ -0,0 +1,2 @@
1
+*/5 * * * * /usr/users/you/infobot0.1b/run_infobots.pl > /dev/null
2
+

+ 13
- 0
conf/infobot.help View File

@@ -0,0 +1,13 @@
1
+main: i learn mainly by observing declarative statements such as "x is at http://www.xxx.com", and then reply when people ask things like "where can i find x?"
2
+
3
+author: oznoid (mailto:lenzo@ri.cmu.edu) is my author.
4
+
5
+corrections: If I come back with "...but x is at http://xx.xx.xx" or something like that, and you want to change the entry, use "no, x is at http://sdfsdfsdf".  The "No," tells me to supercede the existing value.
6
+corrections: You can add to an entry with "also".  "X is also at ..."
7
+
8
+reply: There is a special tag, <reply>, that is used to override the usual response.  Usually, a response is "X is Y", but it can be made "Y" by making the entry "X is <reply> Y".  
9
+reply: This is a good way to close junk entries; use "X is <reply>" with nothing after it.
10
+
11
+alternation: The | symbol in an entry causes an infobot to choose one of the replies at random. "X is Y|Z" will produce "X is Y" or "X is Z" randomly.
12
+
13
+karma: Karma is a community rating system.  use "X++" to increase the karma, or "X--" to decrease it.  Ask for ratings using "karma for X?"

+ 13
- 0
conf/infobot.help-dist View File

@@ -0,0 +1,13 @@
1
+main: i learn mainly by observing declarative statements such as "x is at http://www.xxx.com", and then reply when people ask things like "where can i find x?"
2
+
3
+author: oznoid (mailto:lenzo@ri.cmu.edu) is my author.
4
+
5
+corrections: If I come back with "...but x is at http://xx.xx.xx" or something like that, and you want to change the entry, use "no, x is at http://sdfsdfsdf".  The "No," tells me to supercede the existing value.
6
+corrections: You can add to an entry with "also".  "X is also at ..."
7
+
8
+reply: There is a special tag, <reply>, that is used to override the usual response.  Usually, a response is "X is Y", but it can be made "Y" by making the entry "X is <reply> Y".  
9
+reply: This is a good way to close junk entries; use "X is <reply>" with nothing after it.
10
+
11
+alternation: The | symbol in an entry causes an infobot to choose one of the replies at random. "X is Y|Z" will produce "X is Y" or "X is Z" randomly.
12
+
13
+karma: Karma is a community rating system.  use "X++" to increase the karma, or "X--" to decrease it.  Ask for ratings using "karma for X?"

+ 42
- 0
conf/infobot.users View File

@@ -0,0 +1,42 @@
1
+#
2
+# User File (c) 1998 Infobot & Associates
3
+#
4
+# FLAGS
5
+# ----------------------
6
+# i   Ignored Flag
7
+# f   MLF Usage Allowed
8
+# t   Teaching Allowed
9
+# r   Removing Allowed
10
+# m   Modifying Allowed
11
+# c   Part/Join Allowed
12
+# s   Searching Allowed (possibly computationally expensive)
13
+# S   user can make bot Say things
14
+# e   Extra Privs        [ not implemented robustly: AVOID ]
15
+# p   oP on channel by public request
16
+# ----------------------
17
+# o   Owner Flag
18
+# ----------------------
19
+#
20
+# recommended default user flags: +trmc
21
+
22
+UserEntry default {
23
+	flags +trmcs;
24
+}
25
+
26
+# here's an example entry
27
+
28
+UserEntry oznoid {
29
+	name  "Kevin A. Lenzo";
30
+	title "that guy";
31
+	flags +ftrmcsSope;
32
+	pass  rrmrxB6U4ryRk;
33
+	mask  *!lenzo@*.speech.cs.cmu.edu;
34
+}
35
+
36
+UserEntry plonk {
37
+	name  "Eep Malloy"
38
+	title "that guy II";
39
+	flags +trmcspo;
40
+	pass  rrmrxB6U4ryRk;
41
+	mask  *!*@*.static.telerama.com
42
+}

+ 42
- 0
conf/infobot.users-dist View File

@@ -0,0 +1,42 @@
1
+#
2
+# User File (c) 1998 Infobot & Associates
3
+#
4
+# FLAGS
5
+# ----------------------
6
+# i   Ignored Flag
7
+# f   MLF Usage Allowed
8
+# t   Teaching Allowed
9
+# r   Removing Allowed
10
+# m   Modifying Allowed
11
+# c   Part/Join Allowed
12
+# s   Searching Allowed (possibly computationally expensive)
13
+# S   user can make bot Say things
14
+# e   Extra Privs        [ not implemented robustly: AVOID ]
15
+# p   oP on channel by public request
16
+# ----------------------
17
+# o   Owner Flag
18
+# ----------------------
19
+#
20
+# recommended default user flags: +trmc
21
+
22
+UserEntry default {
23
+	flags +trmcs;
24
+}
25
+
26
+# here's an example entry
27
+
28
+UserEntry oznoid {
29
+	name  "Kevin A. Lenzo";
30
+	title "that guy";
31
+	flags +ftrmcsSope;
32
+	pass  rrmrxB6U4ryRk;
33
+	mask  *!lenzo@*.speech.cs.cmu.edu;
34
+}
35
+
36
+UserEntry plonk {
37
+	name  "Eep Malloy"
38
+	title "that guy II";
39
+	flags +trmcspo;
40
+	pass  rrmrxB6U4ryRk;
41
+	mask  *!*@*.static.telerama.com
42
+}

+ 44
- 0
conf/magic8.txt View File

@@ -0,0 +1,44 @@
1
+original  => Outlook Not So Good
2
+original  => My Reply Is No
3
+original  => Don't Count On It
4
+original  => You May Rely On It
5
+original  => Ask Again Later
6
+original  => Most Likely
7
+original  => Cannot Predict Now
8
+original  => Yes
9
+original  => Yes Definitely
10
+original  => Better Not Tell You Now
11
+original  => It Is Certain
12
+original  => Very Doubtful
13
+original  => It Is Decidedly So
14
+original  => Concentrate and Ask Again
15
+original  => Signs Point to Yes
16
+original  => My Sources Say No
17
+original  => Without a Doubt
18
+original  => Reply Hazy, Try Again
19
+original  => As I See It, Yes
20
+sarcastic => NOT
21
+sarcastic => What do YOU think
22
+sarcastic => Obviously
23
+sarcastic => Ask me if I care
24
+sarcastic => Yeah, and I'm the Pope
25
+sarcastic => That's ridiculous
26
+sarcastic => Who cares
27
+sarcastic => Forget about it
28
+sarcastic => You wish
29
+sarcastic => Yeah, right
30
+sarcastic => Sure
31
+sarcastic => Get a clue
32
+sarcastic => In your dreams
33
+sarcastic => Oh, please
34
+sarcastic => Whatever
35
+sarcastic => As if
36
+sarcastic => You've got to be kidding
37
+sarcastic => Dumb question.  Ask another
38
+sarcastic => Not a chance
39
+userdef   => Outlook Sucks
40
+userdef   => THIS SPACE FOR RENT
41
+userdef   => Bugger Off
42
+userdef   => How appropriate, you fight like a cow
43
+userdef   => Eat more cheese, then ask again
44
+userdef   => When hell freezes over

+ 6
- 0
conf/sane-are.txt View File

@@ -0,0 +1,6 @@
1
+what => <reply>
2
+who => <reply>
3
+when => <reply>
4
+where => <reply>
5
+why => <reply>
6
+it => <reply>

+ 3
- 0
conf/sane-ignore.txt View File

@@ -0,0 +1,3 @@
1
+*cthulhu!hastur@*unspeakable.net # an example nick!user@host ban
2
+*!*@*nan*direct.ca
3
+*!*@200.38.211.*

+ 8
- 0
conf/sane-is.txt View File

@@ -0,0 +1,8 @@
1
+what => <reply>
2
+who => <reply>
3
+when => <reply>
4
+where => <reply>
5
+why => <reply>
6
+it => <reply>
7
+how => <reply>
8
+infobot guide => http://www.cs.cmu.edu/~infobot/infobot_guide.html

+ 37
- 0
doc/how_to_fix_files_uploaded_from_windows_to_unix.txt View File

@@ -0,0 +1,37 @@
1
+FIXING PERL AND TEXT FILES THAT HAVE BEEN UPLOADED FROM WINDOWS
2
+
3
+OK when you upload a file from Windows, it contains all
4
+these nasty control-M's on each line that screw everything
5
+up.
6
+
7
+To see them, use
8
+
9
+   cat -vet <file>
10
+
11
+where <file> is the name of some file you want to check.
12
+You should see the control-M's.  
13
+
14
+To get rid of them, use
15
+
16
+   perl -pi -e 's/\cM//g' <file>
17
+
18
+while <file> is the file name.  This does an in-place edit
19
+that removes all the control-Ms.  You can do this to a bunch
20
+of files at once:
21
+
22
+   perl -pi -e 's/\cM//g' <file1> <file2> <file3>
23
+
24
+or even
25
+
26
+   perl -pi -e 's/\cM//g' *
27
+
28
+if all the files in the directory are text (like they ARE in
29
+the files/ directory of the infobot).
30
+
31
+   perl -pi -e 's/\cM//g' files/* src/* infobot 
32
+
33
+from inside the infobot directory should clean everything up.
34
+You should also clean any factpacks or factoid files or logs
35
+that you use for processing.
36
+
37
+kevin

+ 652
- 0
doc/infobot_guide.html View File

@@ -0,0 +1,652 @@
1
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
+
3
+<html>
4
+  <head>
5
+    <title>Infobot Guide 0.44.3</title>
6
+  </head>
7
+
8
+  <body bgcolor="#ffffff">
9
+    <h1>Infobot Guide 0.44.3</h1>
10
+
11
+<hr>
12
+The canonical source for the infobot source and documentation is
13
+<a href="http://www.cs.cmu.edu/~infobot">http://www.cs.cmu.edu/~infobot</a>.
14
+<hr>
15
+<p>
16
+The infobot connects to an Internet Relay Chat (IRC) server, 
17
+joins some channels (maybe), and begins accumulating factoids.
18
+To run one, download the source, uncompress it, untar it,
19
+edit the config files, and it up.
20
+<p>
21
+Interacting with the bot is pretty straightforward.  Most of
22
+the commands and variables available to users are listed below.
23
+The bot will interact via message or on-channel.
24
+<p>
25
+
26
+<hr>
27
+    <h2> Interacting with an infobot</h2>
28
+
29
+    <UL>
30
+      <LI> <b>setting</b> factoids: X is Y
31
+	<p>
32
+	  Saying something like "X is Y" somewhere that the infobot 
33
+	  can see it will cause the bot to store a factoid, unless
34
+	  X is already defined.  It sets the value of X to Y.
35
+	<p>
36
+      <LI> <b>accessing</b> factoids: What is X?
37
+	<p>
38
+	  You can ask an infobot about something in a number of
39
+	  different ways, including "what is X?", "where is X?",
40
+	  or just plain "X?".
41
+	</p>
42
+	<LI> <b>altering</b> factoids: s/A/B/
43
+	<p>
44
+	if you just want to change a <i>part</i> of a factoid, use
45
+	the <code>s///</code>operator.  you have to address the bot
46
+	or use a private medium to do this.
47
+	<p>
48
+	MyBot, X =~ s/A/B/	
49
+	<p>
50
+	will change the first occurence of A to B in the factoid 
51
+	called X.
52
+	<p>
53
+
54
+      <LI>appending to existing entries: <b><code>also</code></b>
55
+	<p>
56
+	  One can extend an existing factoid using the
57
+	  keyword <code>also</code>
58
+	<p>
59
+	<UL>
60
+	    <code>
61
+	      poink is also a silly word
62
+	    </code>
63
+	</UL>
64
+	<p>
65
+
66
+      <LI>erasing a factoid: <b><code>forget</code></b>
67
+	<p>
68
+	  A factoid can easily be deleted by using
69
+	<p>
70
+	<DIR>
71
+	    <code>
72
+	      infobot, forget poink
73
+	    </code>
74
+	</DIR>
75
+	<p>
76
+
77
+      <LI>changing a factoid: <code><b>no,</b> ...</code>
78
+	<p>
79
+	  You can change the entry for a factoid completely using
80
+	<p>
81
+	<UL>
82
+	    <code>
83
+	      no, infobot, x is wugga wugga.
84
+	    </code>
85
+	</UL>
86
+	    <p>
87
+	  which deletes the prior entry (if possible)
88
+	  and replaces it with the new one.
89
+	<p>
90
+
91
+      <LI> having the bot tell someone else something: <b><code>tell</code></b>
92
+	<p>
93
+	  A user can ask an infobot to tell someone else something.
94
+	  <p>
95
+	  <UL>
96
+	    <code>
97
+	      infobot, tell fimmtiu about no web
98
+	    </code>
99
+	    <p>
100
+	</UL>
101
+
102
+      <LI><b>karma</b> / plusplus
103
+	<p>
104
+	  karma for a concept may be incremented or decremeted using
105
+	  <code>++</code> and <code>--</code>.  You can get the 
106
+	  current karma 'score' for something by asking for it.
107
+	  <p>
108
+	  <UL>
109
+	    <code>
110
+	      oznoid++
111
+	    <p>
112
+	      oznoid--
113
+	    <p>
114
+	      karma for oznoid
115
+	    </code>
116
+	    <p>
117
+	  </UL>
118
+
119
+      <LI> <code><b>status</b></code>
120
+	<p>
121
+	  infobots reply to status requests.
122
+	  <p>
123
+	  <dir>
124
+	  -> [url] status<p>
125
+	    [url!infobot@ALF5.SPEECH.CS.CMU.EDU] Since Fri Mar 26 06:42:27 1999, there have been 409
126
+	    modifications and 2604 questions.  I have been awake for 5 days, 4 hours, 24 minutes,
127
+	    18 seconds this session, and currently reference 47529 factoids.
128
+	  </dir>
129
+
130
+	</p>
131
+
132
+      <LI>joining an allowed channel: <code><b>join</b> #infobot</code>
133
+	<p>
134
+	  On IRC, you can tell the infobot to join a channel
135
+	  that it's allowed to join with
136
+	<p>
137
+	<UL>
138
+	    <code>
139
+	      infobot, join #infobot
140
+	    </code>
141
+	</UL>
142
+	    <p>
143
+	  If it is allowed to (in its paramter settings), it
144
+	  will try to join the channel.
145
+	<p>
146
+	  
147
+
148
+      <LI>leaving a channel: <code><b>part</b> #infobot</code>
149
+	<p>
150
+	  This causes the bot to leave the given channel
151
+	<p>
152
+	<UL>
153
+	    <code>
154
+	      infobot, part #infobot
155
+	    </code>
156
+	</UL>
157
+	    <p>
158
+	  <code>leave</code> is a synonym for <code>part</code>.
159
+	<p>
160
+
161
+      <LI><b>random</b> responses with <code>|</code>
162
+	<p>
163
+	  You can set a list from which to pick a random response by
164
+	  using <code>|</code>
165
+	  <p>
166
+	<UL>
167
+	    <code>
168
+	      x is a|b|c|d
169
+	    </code>
170
+	</UL>
171
+	<p>
172
+	  When x is asked about, the infobot will randomly choose from
173
+	  the <code>|</code>-spearated list.
174
+	<p>
175
+
176
+      <LI> The <b><code>&lt;reply&gt;</code></b> factoid tag.
177
+	<p>
178
+	  Normally, when the infobot replies to "What is X", it says
179
+	  "X is Y".  This form makes it just reply "Y".
180
+	  <p>
181
+	  <UL>
182
+	    <code>
183
+	      X is &lt;reply&gt; Y
184
+	    </code>
185
+	  </UL>
186
+	<p>
187
+
188
+      <LI> The <b><code>&lt;action&gt;</code></b> factoid tag (as of 0.43.5)
189
+	<p>
190
+	This causes the bot to respond as with <reply> except 
191
+	as an ACTION.
192
+	  <p>
193
+	  <UL>
194
+	    <code>
195
+	      X is &lt;action&gt; Y
196
+	    </code>
197
+	  </UL>
198
+	<p>
199
+
200
+      <LI><b>backwacking</b>
201
+	<p>
202
+	  Use <code>\</code> to protect items from evaluation.
203
+	<p>
204
+	<UL>
205
+	    <CODE>
206
+	      x is y is y
207
+	    </CODE>
208
+	</UL>
209
+	<p>
210
+	will normally set <code>x =is=> y is y</code>, but
211
+	<p>
212
+	<UL>
213
+	    <CODE>
214
+	      x \is y is y
215
+	    </CODE>
216
+	</UL>
217
+	<p>
218
+	  will set
219
+		<p>
220
+	      <UL>
221
+		  <code>x is y =is=> y</code>
222
+	      </UL> 
223
+	      <p>
224
+	      The <code>forget</code>
225
+	      and <code>no</code> (update) operators apply before checking
226
+	      for this. This is also useful for getting around the 
227
+	      dereferencing of "i" and "me" and so on.
228
+	<p>
229
+
230
+      <LI>the <b><code>$who</code></b> variable
231
+	<p>
232
+	  Contains the nickname person currently addressing the bot.
233
+	  It can be used effectively in replies.
234
+	  <p>
235
+	  <UL>
236
+	    <code>
237
+	      nice day is &lt;reply&gt; you betcha, $who.
238
+	    </code>
239
+	  </UL>
240
+	<p>
241
+
242
+      <LI>the <b><code>$date</code></b> variable
243
+	<p>
244
+	  Contains the current date and time, at the bot's host.
245
+	<p>
246
+
247
+      <LI> <code><b>weather</b> for KAGC</code> (0.43.6+)
248
+      <p>
249
+      Retrieves the weather from NOAA station KAGC.  See www.noaa.gov.
250
+		Note: Requires LWP.
251
+      <p>   
252
+		<UL>
253
+      <LI> <code><b>metar</b> KAGC</code> (0.43.6+)
254
+	      </UL>
255
+      <p>
256
+      Retrieves METAR info from NOAA station KAGC.  See www.noaa.gov.
257
+		Note: Requires Geo::METAR and LWP.
258
+      <p>   
259
+      <LI> <code><b>nslookup</b> irc.cs.cmu.edu</code>
260
+	<p>
261
+	  performs DNS lookup or reverse-lookup on the hostname or IP.
262
+	<p>
263
+      <LI><code><b>internic</b> yahoo.com</code>
264
+	<p>
265
+	  gets the internic WHOIS record
266
+	<p>
267
+      <LI><code><b>traceroute</b> apple.com</code>
268
+	<p>
269
+	  gets the traceroute results from the bot's machine to the target machine.  Summary only.  
270
+	<p>
271
+      <LI><b>imdb, websters, foldoc</b>
272
+	<p>
273
+	  outputs a well-formed url for a search of IMDB (the Internet Movie DataBase), the Webster's 1913 dictionary, or the foldoc dictionary of geek terms.
274
+	<p>
275
+	<UL>
276
+	    <code>
277
+	      imdb for clerks<p>
278
+	      webster for lucre
279
+	    </code>
280
+	</UL>
281
+
282
+	<p>
283
+
284
+	<LI> New in 0.44.3:
285
+	<p>
286
+	<UL> 
287
+	<LI> <code><b>literal</b> foo</code>
288
+	<p> 
289
+	   returns the value without the usual post-processing. 
290
+        </p>	
291
+	<LI> <code><b>change</b> 100 USD to DEM</code>
292
+	<p>
293
+	converts currency. Retrieves the current exchange rates from the net.
294
+	Requires LWP.
295
+        </p>	
296
+	<LI> <code>&lt;rss="http://www.foo.com/summary.rss"&gt;</code> 
297
+	<p>
298
+	looks up the RSS file (RDF Site Summary) and returns it
299
+	in-place where the tag is. Requires XML::RSS and LWP.
300
+	</p>
301
+	<LI> <code>give me an excuse</code>, or <code>excuse</code>
302
+	<p>
303
+	connects to the excuse server and returns an excuse.
304
+	requires Net::Telnet.
305
+	</p>
306
+	</UL>
307
+	<p>
308
+
309
+      <LI>Ignoring users: <b>ignore</b> nickname, <b>ignore *.a.com</b>
310
+	<p>
311
+		Users with the P (oP) flag can tell the bot
312
+		to ignore people or hostmasks. And 'unignore'.
313
+		use 'ignorelist' to get the current list of ignored masks,
314
+		if you have the P flag.
315
+	</p>
316
+      <LI><code><b>op</b></code> on channel
317
+	<p>
318
+	  The 'p' (oP) flag in the userfile allows this
319
+	  to work. You'll need to set a hostmask. See
320
+	  <code>files/infobot.users</code> Also uses a 
321
+	  crypted password.
322
+	  <p>
323
+	  <dir>
324
+	  <code>
325
+	  /msg &lt;bot&gt; &lt;password&gt; op
326
+	  </code>
327
+	  </dir>
328
+	<p>
329
+      <LI><b><code>die</code></b>
330
+	<p>
331
+	  If the bot owner (+O, Owner) says this or messages it to the bot, 
332
+	  it will kill itself.
333
+	<p>
334
+    </UL>
335
+
336
+<hr>
337
+    <h2> scripts/utilities </h2>
338
+    
339
+    The infobot comes with some scripts for working with
340
+    the DBM files.
341
+    <p>
342
+
343
+    <UL>
344
+      <LI><code>update_db</code>
345
+	<p>
346
+	  This takes a flat ascii file and inserts it into a DBM file.
347
+	  It creates a new DBM if it didn't exist.
348
+	<p>
349
+	<UL>
350
+	    <CODE>
351
+	      scripts/update_db factpacks/code_to_country.txt infobot-is
352
+	    </CODE>
353
+	</UL>
354
+	<p>
355
+	  will add the factoids in <code>code_to_country.txt</code>
356
+	  to the <code>infobot-is</code> DBM.
357
+	<p>
358
+	  If you've set <code>DBMModule</code> in your config file, you
359
+	  need to use the <code>-m</code> switch to specify the alternate
360
+	  module.
361
+	<p>
362
+	<UL>
363
+	    <CODE>
364
+	      scripts/update_db -d DB_File factpacks/code_to_country.txt infobot-is
365
+	    </CODE>
366
+	</UL>
367
+	<p>
368
+      <LI><code>dump_db</code>
369
+	<p>
370
+	  The converse.  It dumps out the DBM file to a flat
371
+	  ascii file. Note there is no extension on the DBM name,
372
+	  even though the system may use one.
373
+	<p>
374
+	<UL>
375
+	    <CODE>
376
+	      scripts/dump_db infobot-is
377
+	    </CODE>
378
+	</UL>
379
+	<p>
380
+	  Note there is no extension on the DBM name, even though the 
381
+	  system may use one (like <code>.pag</code> and 
382
+	  <code>.dir</code> or <code>.db</code>).
383
+	<p>
384
+	  If you've set <code>DBMModule</code> in your config file, you
385
+	  need to use the <code>-m</code> switch to specify the alternate
386
+	  module.
387
+	<p>
388
+	<UL>
389
+	    <CODE>
390
+	      scripts/dump_db -m DB_File infobot-is
391
+	    </CODE>
392
+	</UL>
393
+	<p>
394
+
395
+    </UL>
396
+
397
+<hr>
398
+
399
+    <h3> add-on modules </h3>
400
+
401
+    <UL>
402
+      <LI> <code>nickometer</code>, by Adam Spiers.  Guages
403
+	how 'lame' a nickname is, as a percentage!<p>
404
+	  <UL>
405
+	    <code>
406
+	    nickometer l33tn1ck
407
+	    </code>
408
+	</UL>
409
+	  <p>
410
+
411
+      <LI> <code>babel.pl</code> by jdf. translates using the
412
+	<a href="http://babelfish.altavista.com/">babelfish</a>
413
+	web site for machine translation. 
414
+	In this implementation, English is assumed
415
+	to be the 'main' language, thus everything is
416
+	translated <code>to</code> or <code>from</code> another
417
+	language.  
418
+	<p>
419
+	<UL>
420
+	    <code>
421
+	      (x|translate) (to|from) (de|fr|pt|es|it|german|french|portugese|spanish|italian)
422
+	      <p>
423
+	      translate to german this is a test<br>
424
+	      x to german this is another test<br>
425
+	      x to de and a third<br>
426
+	      x from de ein bisschen Deutsch<p>
427
+	      German, French, Spanish, Italian, and Portugese are
428
+	      currently supported by babelfish.
429
+	    </code>
430
+	</UL>
431
+	<p>
432
+	<LI> <code>METAR</code> support, courtesy of mendel<p>
433
+	  <code>metar KAGC</code>
434
+	<p>
435
+	  retrieves METAR information for KAGC, the Allegheny 
436
+	  County airport station.
437
+	  <p>
438
+      <LI> <code>NOAA</code> weather station support, courtesy of oznoid<p>
439
+	<ul>
440
+	    <code>weather KAGC</code>
441
+	</ul>
442
+	<p>
443
+	  retrieves the 
444
+	  <a href="http://weather.noaa.gov/weather/curcond.html">NOAA</a> 
445
+	  weather information from (in this example) KAGC. uses the
446
+	  same 
447
+	  <a href="http://weather.noaa.gov/weather/curcond.html">codes</a> 
448
+	  as metar info. 
449
+	  <p>
450
+      <LI> <code>slashdot</code> headlines, originally from Chris Tessone, 
451
+	current version from Rahga.<p>
452
+	<p>
453
+	<ul>
454
+	  <code>slashdot</code><br>
455
+	  <code>slashdot headlines</code>
456
+	</ul>
457
+	<p>
458
+	  retrieves the current slashdot headlines from
459
+	  <a href="http://www.slashdot.org">www.slashdot.org</a>.
460
+
461
+      <LI> W3Search: search web engines for links; thanks
462
+	to Simon Couzins for this one. Requires 
463
+	WWW::Search and WWW::Search::Google. 
464
+	<ul>
465
+	    <code>search google for foo</code><br>
466
+	    <code>google for foo</code><br>
467
+	    <code>altavista for foo</code><br>
468
+	    <code>dejanews for foo</code>
469
+	  </ul>
470
+	Currently supports what WWW::Search and WWW::Search::Google
471
+	support, namely:  Dejanews, Google, Gopher, Excite, Infoseek, 
472
+	HotBot, Lycos, AltaVista, Magellan, PLweb, SFgate, and Verity.
473
+	<p>
474
+	<LI>US Airways In-flight info.
475
+	<ul>
476
+	  <code>usair flight 781</code>
477
+	</ul>
478
+	retrieves the in-flight information for the 
479
+	appropriate USAir flight. Note: Requires LWP.
480
+    </UL>
481
+
482
+<hr>
483
+
484
+    <h2> setting up </h2>
485
+
486
+    <h3> configuration </h3>
487
+    <UL> 
488
+      <LI> <b> editing the parameter file </b> 
489
+	<p>
490
+
491
+	  The parameter file, usually in <code>files/infobot.config</code>,
492
+	  is the most direct way to customize the settings on your infobot.
493
+	<p>
494
+
495
+      <LI> <b>editing the user file</b> 
496
+	<p>
497
+
498
+	  The user file, usually in <code>files/infobot.users</code>,
499
+	  is the most direct way to customize the settings on your infobot.
500
+	<p>
501
+
502
+
503
+      <LI> <b> editing the main script </b> 
504
+	<p>
505
+	  
506
+	  There are certain items you may need to fiddle with
507
+	  in the main script of the infobot, but normally you
508
+	  shouldn't have to. The usual reasons are 
509
+	  <p>
510
+	<UL>
511
+	  <LI> <b> changing the bang path to perl </b> 
512
+	    <p>
513
+	      If you get 
514
+	    <p>
515
+	      <UL>
516
+	      <code>
517
+		  infobot: Command not found.
518
+	      </code>
519
+	    </UL>
520
+	    <p>
521
+	      or something like it, you need to edit the infobot
522
+	      script at the top level directory (the script named
523
+	      'infobot') and set the path to you perl interpreter 
524
+	      in the very first line of the script to 
525
+	    <p>
526
+	    <UL>
527
+	      <code>
528
+		#!/path/to/perl
529
+	      </code>
530
+	    </UL>
531
+	    <p>
532
+	      with, of course, the full path to your perl binary.
533
+	    <p>
534
+
535
+	  <LI> <b> explicitly setting normally relative paths </b>
536
+	    <p>
537
+	    If you don't have . in your path, you will probably
538
+	    need to set some variables explicitly that are normally
539
+	    determined relative to the infobot script.  This is 
540
+	    done in the 'infobot' script.
541
+	    <p>
542
+	</ul>
543
+      <LI> <b>Installing Modules to enable features</b>
544
+	<p>
545
+	  Several add-ons, like <code>weather</code> and 
546
+	  web <code>search</code> require perl modules to
547
+	  be installed. The easiest way to get all the 
548
+	  things you need is to install the CPAN.pm module,
549
+	  available from <a href="http://www.perl.com/CPAN/modules-by-module/CPAN/">CPAN</a>, and use it to install what you need.  This
550
+	  is best done as root.<p>
551
+	  Once you have the CPAN module installed, use
552
+	  it to install the required modules:
553
+	<p>
554
+	<ul>
555
+	  <li>the main thing: <code>install Bundle::LWP</code>
556
+	  <li>for METAR: <code>install Geo::METAR</code>
557
+	  <li>for W3Search:
558
+	    <ul>
559
+	      <li><code>install WWW::Search</code>
560
+	      <li><code>install WWW::Search::Google</code>
561
+	    </ul>
562
+	</ul>
563
+	Once these are installed, start or restart your infobot.
564
+    </UL>
565
+    <p>
566
+    </UL>
567
+<hr>
568
+
569
+    <h3> running the infobot </h3>
570
+    
571
+    <UL>
572
+      <LI> <b>starting it up</b>
573
+	<p>
574
+	  This should be as simple as entering the infobot
575
+	  parent directory and executing 
576
+	  <p>
577
+	<UL>
578
+	    <code>
579
+	      infobot
580
+	    </code>
581
+	</UL>
582
+	<p>
583
+
584
+	  This starts up the script and generates a whole lot of text.
585
+	  It's useful and interesting to see what's going on "in the
586
+	  infobot's head".  You can control the amount of verbage
587
+	  that comes out with the <code>VERBOSITY</code> parameter,
588
+	  of you can dump all the output to the bitbucket and background
589
+	  the process at the same time with
590
+	<p>
591
+	<UL>
592
+	    <code>
593
+	      nohup infobot > /dev/null &
594
+	    </code>
595
+	</UL>
596
+	<p>
597
+
598
+      <LI> <b>the console</b>
599
+	<p>
600
+	  Should you choose to look at the stream if consciousness
601
+	  in the bot, and you haven't reduced the output to nothing
602
+	  or consigned it to the void, you will be presented with
603
+	  the <b>console</b>.
604
+	  
605
+	  <p>
606
+	  The first thing you should see, assuming all goes well with
607
+	  making a connection, is the <b>motd</b> (message-of-the-day)
608
+	  of the server the bot has been configured to connect to.
609
+	  <p>
610
+	  Next, you should see the result of the channel joins specified
611
+	  in the parameter files, and you may see the bot recognizing
612
+	  hostmasks of people in the userfile, if any have been put 
613
+	  in there.
614
+	  <p>
615
+	  If you have the <code>ansi_control</code> paramter set,
616
+	  and your terminal supports it, the output will be in color.
617
+	  <p>
618
+	  NOTE that the 'console' is NOT interactive.  You can't
619
+	  type anything into it; it's just for viewing what's going on.
620
+	<p>
621
+      <LI> <b><code>cron</code>ning the infobot</b>
622
+	<p>
623
+	  You can set the infobot to automatically start up using
624
+	  <code>cron</code>.  See the included example <code>crontab</code>
625
+	  file, in <code>files/infobot.crontab</code>
626
+    </UL>
627
+<hr>
628
+    
629
+    <h3> shutting it down </h3>
630
+
631
+    If you have set yourself as the bot's master in the user file
632
+    (<code>infobot.users</code>, unless you changed the default),
633
+    you can just say or message 'die' to the bot.
634
+    <p>
635
+      Otherwise, kill the process or hit control-c in the console.
636
+    <p>
637
+
638
+<hr>
639
+
640
+    <h2> the FAQ </h2>
641
+    The FAQ is available at 
642
+    <a href="http://www.cs.cmu.edu/~infobot/faq/">
643
+      http://www.cs.cmu.edu/~infobot/faq/</a>.  It is growing. Slowly.
644
+
645
+    <hr>
646
+    <address><a href="mailto:infobot@protected.speech.cs.cmu.edu">infobot@protected.speech.cs.cmu.edu</a></address>
647
+<!-- Created: Sat Aug 15 12:00:57 EDT 1998 -->
648
+<!-- hhmts start -->
649
+Last modified: Tue Oct 26 14:24:41 EDT 1999
650
+<!-- hhmts end -->
651
+  </body>
652
+</html>

+ 312
- 0
doc/intro.bit View File

@@ -0,0 +1,312 @@
1
+<hr>
2
+The canonical source for the infobot source and documentation is
3
+<a href="http://www.infobot.org/">http://www.infobot.org/</a>.
4
+<hr>
5
+<p>
6
+The infobot connects to an Internet Relay Chat (IRC) server, 
7
+joins some channels (maybe), and begins accumulating factoids.
8
+To run one, download the source, uncompress it, untar it,
9
+edit the config files, and it up.
10
+<p>
11
+Interacting with the bot is pretty straightforward.  Most of
12
+the commands and variables available to users are listed below.
13
+The bot will interact via message or on-channel.
14
+<p>
15
+
16
+<hr>
17
+    <h2> Interacting with an infobot</h2>
18
+
19
+    <UL>
20
+      <LI> <b>setting</b> factoids: X is Y
21
+	<p>
22
+	  Saying something like "X is Y" somewhere that the infobot 
23
+	  can see it will cause the bot to store a factoid, unless
24
+	  X is already defined.  It sets the value of X to Y.
25
+	<p>
26
+      <LI> <b>accessing</b> factoids: What is X?
27
+	<p>
28
+	  You can ask an infobot about something in a number of
29
+	  different ways, including "what is X?", "where is X?",
30
+	  or just plain "X?".
31
+	</p>
32
+	<LI> <b>altering</b> factoids: s/A/B/
33
+	<p>
34
+	if you just want to change a <i>part</i> of a factoid, use
35
+	the <code>s///</code>operator.  you have to address the bot
36
+	or use a private medium to do this.
37
+	<p>
38
+	MyBot, X =~ s/A/B/	
39
+	<p>
40
+	will change the first occurence of A to B in the factoid 
41
+	called X.
42
+	<p>
43
+
44
+      <LI>appending to existing entries: <b><code>also</code></b>
45
+	<p>
46
+	  One can extend an existing factoid using the
47
+	  keyword <code>also</code>
48
+	<p>
49
+	<UL>
50
+	    <code>
51
+	      poink is also a silly word
52
+	    </code>
53
+	</UL>
54
+	<p>
55
+
56
+      <LI>erasing a factoid: <b><code>forget</code></b>
57
+	<p>
58
+	  A factoid can easily be deleted by using
59
+	<p>
60
+	<DIR>
61
+	    <code>
62
+	      infobot, forget poink
63
+	    </code>
64
+	</DIR>
65
+	<p>
66
+
67
+      <LI>changing a factoid: <code><b>no,</b> ...</code>
68
+	<p>
69
+	  You can change the entry for a factoid completely using
70
+	<p>
71
+	<UL>
72
+	    <code>
73
+	      no, infobot, x is wugga wugga.
74
+	    </code>
75
+	</UL>
76
+	    <p>
77
+	  which deletes the prior entry (if possible)
78
+	  and replaces it with the new one.
79
+	<p>
80
+
81
+      <LI> having the bot tell someone else something: <b><code>tell</code></b>
82
+	<p>
83
+	  A user can ask an infobot to tell someone else something.
84
+	  <p>
85
+	  <UL>
86
+	    <code>
87
+	      infobot, tell fimmtiu about no web
88
+	    </code>
89
+	    <p>
90
+	</UL>
91
+
92
+      <LI><b>karma</b> / plusplus
93
+	<p>
94
+	  karma for a concept may be incremented or decremeted using
95
+	  <code>++</code> and <code>--</code>.  You can get the 
96
+	  current karma 'score' for something by asking for it.
97
+	  <p>
98
+	  <UL>
99
+	    <code>
100
+	      oznoid++
101
+	    <p>
102
+	      oznoid--
103
+	    <p>
104
+	      karma for oznoid
105
+	    </code>
106
+	    <p>
107
+	  </UL>
108
+
109
+      <LI> <code><b>status</b></code>
110
+	<p>
111
+	  infobots reply to status requests.
112
+	  <p>
113
+	  <dir>
114
+	  -> [url] status<p>
115
+	    [url!infobot@ALF5.SPEECH.CS.CMU.EDU] Since Fri Mar 26 06:42:27 1999, there have been 409
116
+	    modifications and 2604 questions.  I have been awake for 5 days, 4 hours, 24 minutes,
117
+	    18 seconds this session, and currently reference 47529 factoids.
118
+	  </dir>
119
+
120
+	</p>
121
+
122
+      <LI>joining an allowed channel: <code><b>join</b> #infobot</code>
123
+	<p>
124
+	  On IRC, you can tell the infobot to join a channel
125
+	  that it's allowed to join with
126
+	<p>
127
+	<UL>
128
+	    <code>
129
+	      infobot, join #infobot
130
+	    </code>
131
+	</UL>
132
+	    <p>
133
+	  If it is allowed to (in its paramter settings), it
134
+	  will try to join the channel.
135
+	<p>
136
+	  
137
+
138
+      <LI>leaving a channel: <code><b>part</b> #infobot</code>
139
+	<p>
140
+	  This causes the bot to leave the given channel
141
+	<p>
142
+	<UL>
143
+	    <code>
144
+	      infobot, part #infobot
145
+	    </code>
146
+	</UL>
147
+	    <p>
148
+	  <code>leave</code> is a synonym for <code>part</code>.
149
+	<p>
150
+
151
+      <LI><b>random</b> responses with <code>|</code>
152
+	<p>
153
+	  You can set a list from which to pick a random response by
154
+	  using <code>|</code>
155
+	  <p>
156
+	<UL>
157
+	    <code>
158
+	      x is a|b|c|d
159
+	    </code>
160
+	</UL>
161
+	<p>
162
+	  When x is asked about, the infobot will randomly choose from
163
+	  the <code>|</code>-spearated list.
164
+	<p>
165
+
166
+      <LI> The <b><code>&lt;reply&gt;</code></b> factoid tag.
167
+	<p>
168
+	  Normally, when the infobot replies to "What is X", it says
169
+	  "X is Y".  This form makes it just reply "Y".
170
+	  <p>
171
+	  <UL>
172
+	    <code>
173
+	      X is &lt;reply&gt; Y
174
+	    </code>
175
+	  </UL>
176
+	<p>
177
+
178
+      <LI> The <b><code>&lt;action&gt;</code></b> factoid tag (as of 0.43.5)
179
+	<p>
180
+	This causes the bot to respond as with <reply> except 
181
+	as an ACTION.
182
+	  <p>
183
+	  <UL>
184
+	    <code>
185
+	      X is &lt;action&gt; Y
186
+	    </code>
187
+	  </UL>
188
+	<p>
189
+
190
+      <LI><b>backwacking</b>
191
+	<p>
192
+	  Use <code>\</code> to protect items from evaluation.
193
+	<p>
194
+	<UL>
195
+	    <CODE>
196
+	      x is y is y
197
+	    </CODE>
198
+	</UL>
199
+	<p>
200
+	will normally set <code>x =is=> y is y</code>, but
201
+	<p>
202
+	<UL>
203
+	    <CODE>
204
+	      x \is y is y
205
+	    </CODE>
206
+	</UL>
207
+	<p>
208
+	  will set
209
+		<p>
210
+	      <UL>
211
+		  <code>x is y =is=> y</code>
212
+	      </UL> 
213
+	      <p>
214
+	      The <code>forget</code>
215
+	      and <code>no</code> (update) operators apply before checking
216
+	      for this. This is also useful for getting around the 
217
+	      dereferencing of "i" and "me" and so on.
218
+	<p>
219
+
220
+      <LI>the <b><code>$who</code></b> variable
221
+	<p>
222
+	  Contains the nickname person currently addressing the bot.
223
+	  It can be used effectively in replies.
224
+	  <p>
225
+	  <UL>
226
+	    <code>
227
+	      nice day is &lt;reply&gt; you betcha, $who.
228
+	    </code>
229
+	  </UL>
230
+	<p>
231
+
232
+      <LI>the <b><code>$date</code></b> variable
233
+	<p>
234
+	  Contains the current date and time, at the bot's host.
235
+	<p>
236
+
237
+	<LI> <code><b>literal</b> foo</code>
238
+	<p> 
239
+	   returns the value without the usual post-processing. 
240
+        </p>	
241
+	<p>
242
+
243
+      <LI>Ignoring users: <b>ignore</b> nickname, <b>ignore *.a.com</b>
244
+	<p>
245
+		Users with the P (oP) flag can tell the bot
246
+		to ignore people or hostmasks. And 'unignore'.
247
+		use 'ignorelist' to get the current list of ignored masks,
248
+		if you have the P flag.
249
+	</p>
250
+      <LI><code><b>op</b></code> on channel
251
+	<p>
252
+	  The 'p' (oP) flag in the userfile allows this
253
+	  to work. You'll need to set a hostmask. See
254
+	  <code>files/infobot.users</code> Also uses a 
255
+	  crypted password.
256
+	  <p>
257
+	  <dir>
258
+	  <code>
259
+	  /msg &lt;bot&gt; &lt;password&gt; op
260
+	  </code>
261
+	  </dir>
262
+	<p>
263
+      <LI><b><code>die</code></b>
264
+	<p>
265
+	  If the bot owner (+O, Owner) says this or messages it to the bot, 
266
+	  it will kill itself.
267
+	<p>
268
+    </UL>
269
+
270
+<hr>
271
+    <h2> scripts/utilities </h2>
272
+    
273
+    The infobot comes with some scripts for working with
274
+    the DBM files.
275
+    <p>
276
+
277
+    <UL>
278
+      <LI><code>update_db</code>
279
+	<p>
280
+	  This takes a flat ascii file and inserts it into a DBM file.
281
+	  It creates a new DBM if it didn't exist.
282
+	<p>
283
+	<UL>
284
+	    <CODE>
285
+	      scripts/update_db factpacks/code_to_country.txt infobot-is
286
+	    </CODE>
287
+	</UL>
288
+	<p>
289
+	  will add the factoids in <code>code_to_country.txt</code>
290
+	  to the <code>infobot-is</code> DBM.
291
+	<p>
292
+      <LI><code>dump_db</code>