view config.feeds.example @ 698:6ba9f961e463 default tip

quotedb: Bump version and copyright.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 18 Sep 2023 11:38:41 +0300
parents 8bde8f798188
children
line wrap: on
line source

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

# SQLite3 database
set feeds_db_file "/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]
}


# Name of the command used for help texts
set feeds_cmd_name "!feeds"


# Initialization proc called only by feeds.tcl
proc feeds_init { } {
  # Bind commands
  bind pub - !feed feeds_cmd_pub
  bind pub - !feeds feeds_cmd_pub
  bind pub - !last feeds_cmd_pub_last
  bind pub - !latest feeds_cmd_pub_last

  bind msg - !feed feeds_cmd_msg
  bind msg - !feeds feeds_cmd_msg
  bind msg - !last feeds_cmd_msg_last
  bind msg - !latest feeds_cmd_msg_last
}


# Sub-command name regexp patterns
array set feeds_commands {
  "help" {^(\?|help|apua)$}
  "latest" {^(last|latest|uusin?)$}
  "force" {^(force?|fet|fetch)$}
  "list" {^(list|listaa?)$}
  "history" {^(hist|historia)$}
  "all" {^(all|long|kaikki)$}
}


# 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"
}


# History limit
set feeds_history_limit 4


# 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 {

  "help_full" {"help_latest" "help_list" "help_history" "help_force"}
  "help_short" "@cmd@ latest \[<feedin nimi patterni>\] \002|\002 hist \[<feedin nimi patterni>\] \002|\002 list \[long\] \[<feedin nimi patterni>\]"

  "help_latest" "@cmd@ latest \[<feedin nimi patterni>\]"

  "chk_unsync_entries" "Epäsynkki tai liikaa uusia feedejä."
  "chk_new_entries" "@1@ uutta sitten ajankohdan @2@ / @3@."
  "chk_entry" "@1@: @4@ \002@2@\002 -- @3@"

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

  "feed_list_active" "Aktiiviset feedit (uudemmat kuin \002@1@\002) -- @2@"
  "feed_list_all" "Kaikki feedit:\n@1@"
  "feed_list_filter" "Kaikki '\002@1@\002' mätsäävät feedit:\n@2@"

  "feed_list_item_short" "@1@ (@2@)"
  "feed_list_sep_short" ", "

  "feed_list_item_long" "@1@ (@2@) @3@ @4@"
  "feed_list_sep_long" "\n"

  "feed_list_long_denied" "EIII PYSTY, koita privana @cmd@ @1@"
  "help_list" "@cmd@ list \[long\] \[feedin nimi patterni\]"

  "history_list" "Feedin '@1@' historia:\n@2@"
  "history_list_item" "@3@: '@2@' -- @1@"
  "history_list_sep" "\n"

  "help_history" "@cmd@ hist <feedin nimi patterni>"

  "multiple_matches" "'@1@' mätsää useampaan kuin yhteen feedin nimeen."
  "no_matches"  "Ei löydy feediä haulla '@1@'."

  "help_force" "@cmd@ force"
}