 
     robot.send {room: msg.message?.user?.name}, cmds.join "\n"
 
+    logmsg = "#{modulename}: robot responded to #{msg.envelope.user.name}: " +
+      "displayed #{modulename} help"
+    robot.logger.info logmsg
+
   robot.respond /fw (?:blacklist|b)$/i, (msg) ->
     logmsg = "#{modulename}: #{msg.envelope.user.name} requested: blacklist"
     robot.logger.info logmsg
-    data = fs.readFileSync blacklistfile, 'utf-8'
 
-    robot.send {room: msg.message?.user?.name}, data.join "\n"
+    arr = ['Blacklist items and expirations:']
+    for obj in data
+      expires = moment(obj.expires)
+      if expires.isAfter()
+        arr.push "`#{obj.val}` #{expires.fromNow()}"
+    robot.send {room: msg.message?.user?.name}, arr.join "\n"
+
+    logmsg = "#{modulename}: robot responded to #{msg.envelope.user.name}: " +
+      "displayed blacklist items and expirations"
+    robot.logger.info logmsg
 
   robot.respond /fw (?:blacklist|b) (url|cidr) ([^ ]+)(?: ([^ ]+)|)$/i, (msg) ->
     bl =

modulename = 'fw'
blacklistfile = modulename + ".json"

try
  fwdata = fs.readFileSync blacklistfile, 'utf-8'
  if fwdata
    data = JSON.parse(fwdata)
catch error
  console.log('Unable to read file', error) unless error.code is 'ENOENT'

module.exports = (robot) ->

  robot.router.get "/#{robot.name}/bl", (req, res) ->
    arr = []
    for obj in data
      arr.push obj.val # XXX: unless expired
    content = '# nothing here yet! #'
    content = arr.join "\n" if arr.length
    res.setHeader 'content-type', 'text/plain'
    res.end content

  robot.respond /fw(?: help)$/, (msg) ->
    cmds = []
    arr = [
      modulename + " blacklist - show blacklist"

      logmsg = "#{modulename}: #{msg.envelope.user.name} requested: " +
        "blacklist #{bl.type} #{bl.val} expires #{bl.expires}"
      robot.logger.info logmsg

      data.push bl
      fs.writeFileSync blacklistfile, JSON.stringify(data), 'utf-8'

      logmsg = "#{modulename}: robot responded to #{msg.envelope.user.name}: " +
        "added entry to blacklist"
      robot.logger.info logmsg
