view config.feeds.example @ 550:85fe3bc36307

Rename *_logmsg settings to *_log_enable.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 08 Jul 2020 22:55:56 +0300
parents c6f389bef58e
children 0ce432c3f03f
line wrap: on
line source

##########################################################################
#
# Feeds script and fetcher script configuration
#
##########################################################################

# SQLite3 database
set feeds_dbfile "/home/niinuska/bot/feeds.sqlite"


proc feeds_cmd_pub_last {unick uhost uhand uchan utext} {
  return [feeds_cmd $unick $uhost $uhand $uchan "last $utext" 1]
}

proc feeds_cmd_msg_last {unick uhost uhand utext} {
  return [feeds_cmd $unick $uhost $uhand "PRIV" "last $utext" 0]
}


proc feeds_cmd_pubm_last {unick uhost uhand uchan utext} {
  return [feeds_cmd $unick $uhost $uhand $uchan "last [feeds_cmdm_split $utext]" 1]
}

proc feeds_cmd_msgm_last {unick uhost uhand utext} {
  return [feeds_cmd_msg $unick $uhost $uhand "PRIV" "last [feeds_cmdm_split $utext]" 0]
}


# Initialization proc called only by feeds.tcl
proc feeds_init { } {
  # Bind commands
  bind pubm - !feed* feeds_cmd_pubm
  bind pub - !last feeds_cmd_pub_last
  bind pubm - !lates* feeds_cmd_pubm_last

  bind msgm - !feed* feeds_cmd_msgm
  bind msg - !last feeds_cmd_msg_last
  bind msgm - !lates* feeds_cmd_msgm_last
}


# Proc for fetching the feeds data, called by fetch_feeds.tcl
proc feeds_fetch { } {
  #fetch_poliisi "http://www.poliisi.fi/oulu/tiedotteet/1/0?all1/0" "Poliisi/Oulu" "http://www.poliisi.fi"

  fetch_halla_aho

  fetch_adventurers

  fetch_oots

  add_rss_feed "https://effi.org/feed/" "EFFI" ""
}


# How often to check for newly added feed items from the database?
# (in minutes) This has nothing to do how often the backend script
# is run and actually scans / pulls the feeds, that is done in CRON.
# See get_feeds.tcl for more information.
set feeds_check_period 5


# Limit / number of new feed items allowed to be published
# after which situation is considered unsynchronized / spam and
# none of the new items are published.
set feeds_sync_limit 10


# Set channels and feed filters here:
# "#channel" "feedname|feedname2"
# feednames can use matching, e.g. "mtv3*" would match all beginning with "mtv3"
array set feeds_channels {
  "#mazmlame" "the adventurers|oots|mestari|effi"
  "#fireball" "mestari|effi"
}


# 1 = Enable logging of various script actions into bot's log
# 0 = Don't.
set feeds_log_enable 1


# What IRC "command" should we use to send messages:
# (Valid alternatives are "PRIVMSG" and "NOTICE")
set feeds_preferredmsg "PRIVMSG"


###
### HTTP options
###
# Set to 1 if you want to enable use of HTTP proxy.
# If you do, you MUST set the proxy settings below too.
set http_use_proxy 0

# Proxy host and port number (only used if enabled above)
set http_proxy_host ""
set http_proxy_port 8080

# Enable TLS/SSL support. You need to set http_tls_cadir.
set http_tls_support 1
set http_tls_cadir "/usr/share/ca-certificates/mozilla"

# Set 'user agent' string for HTTP. If empty or not set, default will be used.
#set http_user_agent "Mozilla"


###
### Messages
###

array set feeds_messages {

  "usage_full" {"usage_help"}
  "usage_help" "@cmd@ \[latest \[<feed>\]|list|history\]"

  "chk_unsync_entries" "Epäsynkki."
  "chk_new_entries" "@1@ uutta."
  "chk_entry" "@1@: @4@ \002@2@\002 -- @3@"

  "search_latest_feed" "Uusin '@1@' / @2@: @3@ -- @4@"
  "search_no_matches"  "Ei osumia haulla '@1@'."

  "history_list" "Feedien historia: @1@"
  "history_list_item" "@1@ (@2@)"
  "history_list_sep" ", "
}