#  .ebrc: sample configuration file for edbrowse

#  email account; you may have several.
#  a gmail account, most people have one of these now adays.
#  This is pop3 access. To fetch and read your mail from this account:
#  edbrowse -fm1
mail {
inserver = pop.gmail.com
outserver = smtp.gmail.com
secure
login = edbrowse
password = rhinoceros
from = Donald Duck
reply = edbrowse@gmail.com
}

#  Imap access to your gmail account.
#  If this remains the second email account in this file, then imap access is:
#  edbrowse -f2
mail {
imap
inserver = imap.gmail.com
outserver = smtp.gmail.com
secure
login = edbrowse
password = rhinoceros
from = Donald Duck
reply = edbrowse@gmail.com
}

#  Add address book.
#adbook=/home/mylogin/outside/adbook

#  inbox. Should be an absolute path.
#maildir = /home/mylogin/mbox

#  Place downloaded files here. Should be an absolute path.
# downdir = /home/mylogin/downloads
# If missing, downloads take place wherever you are.

#  The cookie jar - where we store the http cookies.
#jar = /home/mylogin/outside/cookies

# directory holding the edbrowse cache, and the size of the cache in megabytes
# cachedir = /b3/ebcache
# cachesize = 200

#  wait 30 seconds for a response from a web server
webtimer = 30
#  wait 3 minutes for a response from a mail server
mailtimer = 180

#  Redirect mail based on the sender, or the destination account.
fromfilter {
fred flintstone > fredmail
fred.flintstone@bedrock.us > fredmail
jerk@hotmail.com > x
word@m-w.com > -wod
}

# tofilter { }

#  Describe the mime types and the plugins to run them.
plugin {
type = audio/basic
desc = audio file in a wave format
suffix = wav,voc,au,ogg
content = audio/x-wav
#  %i is the temp input file generated by edbrowse, or the url
program = play -q %i
}

plugin {
type = audio/mp3
desc = audio file in mp3 format
suffix = mp3
content = audio/mpeg
program = mpg123 -q -C %i
}

plugin {
type = audio/x-pn-realaudio
desc = streaming audio
protocol = rtsp,pnm,sdp
suffix = rm,ra,ram,m3u8
urlmatch = youtube.com/watch?|youtube.com/embed/
content = audio/x-scpls,application/pls+xml
program = /usr/bin/mpv --really-quiet --load-unsafe-playlists %i
}

#  this plugin renders a file, rather than "playing" the file.
plugin {
type = pdf
desc = pdf file
suffix = pdf
content = application/pdf
program = pdftohtml -i -q -noframes %i %o
#  indicate the output is in html, rather than text
outtype = H
#  indicate the data must be downloaded; pdftohtml does not take a url
down_url
}

plugin {
type = rtf
desc = rich text file
suffix = rtf
content = application/rtf
down_url
program = catdoc %i
# this is text, not html
outtype = T
}

#  Every time you fetch a web page from the internet,
#  your browser identifies itself to the host.
# Here are some alternate agents, default is edbrowse
agent = Lynx/2.8.4rel.1 libwww-FM/2.14
agent = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)

#  Ok, we're ready to write our first script.
#  How about a function to access google.
#  So   <gg elephants tigers   will call up google,
#  looking for elephants and tigers together.
function+gg {
db0
b http://www.google.com
sw+
/<>/ i=~0
db1
/</ i1*
/h3/p
}

#  Merriam-Webster dictionary lookup, ~1 is parameter 1, the word to look up.
#  <mw elephant
function+mw {
b http://www.merriam-webster.com/dictionary/~0
sw+
/spelling suggestion/X
if(*){
/{.*}?/
} else {
/^h1/X
/^h2/
}
}

#  This function is run at edbrowse startup.
function:init {
# make directories writable, so you can rename or delete files
dw
# Display the size of each file in a directory listing
ls=s
# character limit when displaying a line; lines can be arbitrarily long inside.
ll 700
# other personal settings
}

# and much more...
