1
# .ebrc: the configuration file for edbrowse (version 2.2 or above)
2
# This is a sample file.
3
# This file contains passwords - make sure it is not readable by others.
5
# (Of course this public file has no real passwords, but yours will.)
7
# First the email accounts; I have several.
8
# My primary account, from my ISP.
9
# Access this account via -m1.
10
# The next account is -m2, and so on.
12
# The pop3 server and the smtp server, they need not be the same.
13
inserver = mail.comcast.net
14
outserver = smtp.comcast.net
18
# Who is this mail from? Your name, and a reply address.
19
# Note, it is now illegal to forge email, so make sure your name
20
# is really yours, or your business, and make sure the reply address
21
# is one of your email accounts, or is forwarded to you.
23
reply = kdahlke189603@comcast.net
26
# My personal email account.
27
# This is a subaccount under my primary ISP account.
29
inserver = mail.comcast.net
30
outserver = smtp.comcast.net
31
# When I send mail out, this is the default account.
36
reply = eklhad@comcast.net
40
# I check on it once in a while, with her permission of course.
42
inserver = mail.comcast.net
43
outserver = smtp.comcast.net
47
reply = kdwife@comcast.net
52
# The shortcut eyemail is defined in /etc/hosts.
53
# You can do it this way, or use a full domain name,
54
# as I did with comcast.
57
login = karl.dahlke@my-work-domain.com
60
reply = karl.dahlke@my-work-domain.com
63
# Mail that looks like it came from my other web sites.
64
# Let's start with the math site.
66
inserver = mail.comcast.net
67
outserver = mail.comcast.net
71
# All MathReference email is forwarded to me.
72
reply = webmaster@mathreference.com
76
inserver = mail.comcast.net
77
outserver = mail.comcast.net
80
# My wife and I work on this site together.
81
from = Karl and Wendy Dahlke
82
reply = webmaster@scrapsayings.com
85
# An email associated with my private domain, independent of my ISP
86
# This is forwarded to my ISP.
88
inserver = mail.comcast.net
89
outserver = mail.comcast.net
93
reply = eklhad@comcast.net
96
# That's all the mail accounts.
97
# Here is my address book.
98
# Format is alias:email:other fields.
99
adbook=/home/eklhad/outside/adbook
101
# Move to this directory when fetching mail.
102
maildir = /home/eklhad/mbox
104
# ip addresses on the blacklist
105
ipblack=/home/eklhad/outside/ipblack
107
# The cookie jar - where we store the http cookies.
108
# This file contains passwords, make sure it is 0600.
109
# Do not hand edit this file, unless you know what you are doing!
110
jar = /home/eklhad/outside/cookies
112
# file of ssl certificates
113
# If you put your file here, it will be shared with lynx, and perhaps other browsers.
114
certfile = /etc/ssl/cert.pem
116
# wait 30 seconds for a response from a web server
118
# wait 3 minutes for a response from a mail server
121
# Write spam messages here. I use a file in my trash bin,
122
# so I know it gets cleaned out every week.
123
spamcan = /home/eklhad/.Trash/spamcan
125
# Redirect mail based on the sender, or the destination account.
127
fred flintstone > fredmail
128
fred.flintstone@bedrock.us > fredmail
134
support@my-side-business.com > support
135
sales@my-side-business.com > sales
136
@my-side-business.com > business
137
me@my-regular-dayjob.com > work
140
# Describe the mime types and the programs to run them.
141
# For obvious reasons, I'm only worried about the audio -
142
# though there may be some application files that could be meaningfully processed.
145
desc = audio file in a wave format
147
# The star is replaced with the suffix at runtime
148
program = play -t * -
153
desc = audio file in mp3 format
155
#program = mpg123 -q -
156
# The above line works, but can be inconvenient, depending on the player.
157
# Some mp3 players don't work as well
158
# when they get their input from a pipe.
159
# When it comes from a file, they respond better to keyboard commands,
160
# to pause, back up, etc.
161
# So I invented a special % character at the end,
162
# which becomes a temp file with the proper suffix.
163
program = mpg123 -q %
164
# And we could have done the same with play above.
166
# Then you wouldn't need the -t *
167
# because the temp file has the right suffix, and play understands.
171
# the < forces it to be a stream, hence the url is passed to the program
172
type = <audio/x-pn-realaudio
173
desc = streaming audio
180
# Database access - specify the database, login, and password.
181
database = retail,mylogin,mypassword
183
# Sections of the customers table in the retail database.
184
# See the edbrowse documentation for more details.
187
# cnm is my cryptic shorthand for customer name
188
# I want to be cryptic here, cause I'm going to be typing this a lot.
190
cols = custnum,firstname,lastname
191
# Specify the primary key, in this case, the first column selected.
197
# All I care about here is customer and birthdate.
199
cols = birthdate,custnum
204
# Plenty of sites use javascript solely for visual effect.
205
# And this javascript tends to be complicated, which means I usually
206
# don't parse it properly, and you get lots of annoying errors.
207
# You can disable it per site.
208
# Note, better to say space.com, instead of www.space.com,
209
# unless there is a foo.space.com where you really need the javascript.
215
# Every time you fetch a web page from the internet,
216
# your browser identifies itself to the host.
217
# This is done automatically.
218
# Edbrose identifies itself as "edbrowse/2.1.3",
219
# where the number after the slash indicates the current version of edbrowse.
220
# All well and good, but some websites have no respect for edbrowse,
221
# or lynx for that matter.
222
# They won't let you in the door unless you look like Explorere or Netscape.
223
# Clickbank.com, a major credit card processor, is one example.
224
# So what do we do? We lie!
225
# You can specify different agents in this config file,
226
# and activate them with the `ua' (user agent) command.
227
# With the following lines in your config file,
228
# you can type ua1 to pretend to bee lynx, and ua2 to pretend to be Mozilla.
229
# Type ua0 to resurrect the standard edbrowse identification.
231
agent = Lynx/2.8.4rel.1 libwww-FM/2.14
232
agent = Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)
234
# Ok, we're ready to write our first script.
235
# Let's start out with something simple.
236
# undos and unword a file.
237
# No doubt a Windows expert could help me with the latter.
245
# Strip out nonascii stuff.
246
# Sorry to be so English-centric.
247
# This will mess you up if you're reading a Spanish word document,
248
# and you lose your nonascii letters.
249
,s/[\0-\11\13\14\16-\37\200-\377]//g
250
# After the above, there'll be lots of blank lines.
252
# Break lines at return boundaries.
254
# Strip off trailing junk.
258
# How about a function to access google.
259
# That's something everybody does all the time.
260
# I went to the home page, put in some keywords, set db2,
261
# and pressed search.
262
# That gave me the url.
263
# Here it is, with ~0 embedded.
264
# ~0 stands for all the arguments, in other words, the rest of the line.
265
# So <gg elephants tigers will call up google,
266
# looking for "elephants tigers".
268
b www.google.com/search?q=~0&hl=n&btnG=Google+Search&meta=
269
# Ok, we got the web page back.
270
# How do we know? Go back and look at the function line.
271
# The + means stop if there are any errors.
272
# We're still here, so I guess there weren't any errors.
273
# Google has returned its results.
274
# But there's lots of text that I don't care to read.
275
# So I wrote a google cleanup function.
277
# It's ok that this function hasn't been defined yet;
278
# forward references are allowed.
282
# The google cleanup function.
283
# This is called when you access google (above),
284
# but you may want to call it again, when you ask for the next ten results,
285
# and the next ten results, etc.
286
# That's why I made it a separate function.
287
# Look at the function definition and note the : instead of +
288
# This means the function will march on, even if there are errors.
289
# This lets us delete certain lines, if they are there.
290
# And if they're not there, we get an error, and march on.
293
# get rid of pdf warnings
294
g/^Your browser may not have a PDF reader available.$/d
295
g/^{Similar pages}$/d
296
# trailing lines, after "search next", can go away
297
/^{search Next}$/+,$d
298
# initial lines and stats can go away
299
1,/Search took [\d.]+ seconds/d
300
# move the "did you mean" line to the end; we need to keep this one
301
/^Did you mean:$/,/^Did you mean:$/+2m$
302
# more stuff at the start that we don't need
303
1,/^Categor[iesy]+: *|/d
304
1,/{See your message here...}/d
305
1,/^|Sponsored Link$/d
306
# First two nonblank lines and first blank line can go away
310
# put the "did you mean" line back to the top, if it's there
311
/^Did you mean:$/,$m0
314
# mariam-webster dictionary lookup
316
# You can't see it, unless you list the line, but there is
317
# a control a between dictionary and book.
318
# This indicates post method, rather than get method.
319
b www.m-w.com/cgi-bin/dictionarybook=Dictionary&va=~1
324
/^{Get the Word of the Day/,$d
325
1,/^Click on the Collegiate Thesaurus tab to look up the current word/+2d
327
1,/^One entry found for/+d
328
1,/^Suggestions for/-d
331
# Clean up an article from www.space.com.
332
# Now you're ready for the big time.
333
# if(*) means proceed if the previous command succeeded.
334
# if(?) means proceed if the previous command failed.
335
# Get it ... ? as in the question mark of an error.
336
# Similarly for while(*), until(*), etc.
337
# There is also a loop(n) construct, to repeat something n times.
339
# stuff at the end can go
340
/^{Add these headlines to your site}$/,$d
341
# All the stuff at the top, before the word posted, can go
344
# now the top line is the date, don't need it
349
# We don't care about the section called images, which is inserted
350
# after the first paragraph of the article.
351
/^| *Images\|More Stories$/d
353
# delete some sections before this line, and after it.
354
?^|SCIENCE TUESDAY\||TECH WEDNESDAY$?,-d
355
.,/{>>Uplink your views}/d
359
.,/^| *More Stories$/d
360
.,/^| *Related SPACE.com STORIES$/d
361
.,/^| *Related Links$/d
368
# Now print the article