comparison config.feeds.example @ 549:c6f389bef58e

feeds: Largely refactor feeds.tcl, bump version to 2.0.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 08 Jul 2020 17:09:07 +0300
parents 461be6f596bd
children 85fe3bc36307
comparison
equal deleted inserted replaced
548:028ee7efd4ff 549:c6f389bef58e
4 # 4 #
5 ########################################################################## 5 ##########################################################################
6 6
7 # SQLite3 database 7 # SQLite3 database
8 set feeds_dbfile "/home/niinuska/bot/feeds.sqlite" 8 set feeds_dbfile "/home/niinuska/bot/feeds.sqlite"
9
10
11 proc feeds_cmd_pub_last {unick uhost uhand uchan utext} {
12 return [feeds_cmd $unick $uhost $uhand $uchan "last $utext" 1]
13 }
14
15 proc feeds_cmd_msg_last {unick uhost uhand utext} {
16 return [feeds_cmd $unick $uhost $uhand "PRIV" "last $utext" 0]
17 }
18
19
20 proc feeds_cmd_pubm_last {unick uhost uhand uchan utext} {
21 return [feeds_cmd $unick $uhost $uhand $uchan "last [feeds_cmdm_split $utext]" 1]
22 }
23
24 proc feeds_cmd_msgm_last {unick uhost uhand utext} {
25 return [feeds_cmd_msg $unick $uhost $uhand "PRIV" "last [feeds_cmdm_split $utext]" 0]
26 }
27
28
29 # Initialization proc called only by feeds.tcl
30 proc feeds_init { } {
31 # Bind commands
32 bind pubm - !feed* feeds_cmd_pubm
33 bind pub - !last feeds_cmd_pub_last
34 bind pubm - !lates* feeds_cmd_pubm_last
35
36 bind msgm - !feed* feeds_cmd_msgm
37 bind msg - !last feeds_cmd_msg_last
38 bind msgm - !lates* feeds_cmd_msgm_last
39 }
9 40
10 41
11 # Proc for fetching the feeds data, called by fetch_feeds.tcl 42 # Proc for fetching the feeds data, called by fetch_feeds.tcl
12 proc feeds_fetch { } { 43 proc feeds_fetch { } {
13 #fetch_poliisi "http://www.poliisi.fi/oulu/tiedotteet/1/0?all1/0" "Poliisi/Oulu" "http://www.poliisi.fi" 44 #fetch_poliisi "http://www.poliisi.fi/oulu/tiedotteet/1/0?all1/0" "Poliisi/Oulu" "http://www.poliisi.fi"
37 68
38 # Set channels and feed filters here: 69 # Set channels and feed filters here:
39 # "#channel" "feedname|feedname2" 70 # "#channel" "feedname|feedname2"
40 # feednames can use matching, e.g. "mtv3*" would match all beginning with "mtv3" 71 # feednames can use matching, e.g. "mtv3*" would match all beginning with "mtv3"
41 array set feeds_channels { 72 array set feeds_channels {
42 "#mazmlame" "the adventurers|oots|mestari|blastwave" 73 "#mazmlame" "the adventurers|oots|mestari|effi"
43 "#fireball" "mestari" 74 "#fireball" "mestari|effi"
44 "#tnsp" "the adventurers|oots|mestari"
45 } 75 }
46 76
47 77
48 # 1 = Enable logging of various script actions into bot's log 78 # 1 = Enable logging of various script actions into bot's log
49 # 0 = Don't. 79 # 0 = Don't.
70 set http_tls_support 1 100 set http_tls_support 1
71 set http_tls_cadir "/usr/share/ca-certificates/mozilla" 101 set http_tls_cadir "/usr/share/ca-certificates/mozilla"
72 102
73 # Set 'user agent' string for HTTP. If empty or not set, default will be used. 103 # Set 'user agent' string for HTTP. If empty or not set, default will be used.
74 #set http_user_agent "Mozilla" 104 #set http_user_agent "Mozilla"
105
106
107 ###
108 ### Messages
109 ###
110
111 array set feeds_messages {
112
113 "usage_full" {"usage_help"}
114 "usage_help" "@cmd@ \[latest \[<feed>\]|list|history\]"
115
116 "chk_unsync_entries" "Epäsynkki."
117 "chk_new_entries" "@1@ uutta."
118 "chk_entry" "@1@: @4@ \002@2@\002 -- @3@"
119
120 "search_latest_feed" "Uusin '@1@' / @2@: @3@ -- @4@"
121 "search_no_matches" "Ei osumia haulla '@1@'."
122
123 "history_list" "Feedien historia: @1@"
124 "history_list_item" "@1@ (@2@)"
125 "history_list_sep" ", "
126 }