@@ -16,7 +16,7 @@ import (
16
16
// Yaml mapping to yaml configuration
17
17
type yamlContents struct {
18
18
SlackOverflow struct {
19
- LogLevel string `yaml:"log_level "`
19
+ LogLevel string `yaml:"log-level "`
20
20
Watch int `yaml:"watch"`
21
21
} `yaml:"slackoverflow"`
22
22
Slack struct {
@@ -26,11 +26,14 @@ type yamlContents struct {
26
26
APIHost string `yaml:"api-host"`
27
27
} `yaml:"slack"`
28
28
StackExchange struct {
29
- Enabled bool `yaml:"enabled"`
30
- Key string `yaml:"key"`
31
- APIVersion string `yaml:"api-version"`
32
- APIHost string `yaml:"api-host"`
33
- SearchAdvanced map [string ]string `yaml:"search-advanced"`
29
+ Enabled bool `yaml:"enabled"`
30
+ Key string `yaml:"key"`
31
+ APIVersion string `yaml:"api-version"`
32
+ APIHost string `yaml:"api-host"`
33
+ Site string `yaml:"site"`
34
+ QuestionsToWatch int `yaml:"questions-to-watch"`
35
+ SearchAdvanced map [string ]string `yaml:"search-advanced"`
36
+ Questions map [string ]string `yaml:"questions"`
34
37
} `yaml:"stackexchange"`
35
38
}
36
39
@@ -119,14 +122,6 @@ func (yc *yamlContents) ConfigureSlackOverflow() {
119
122
std .Hr ()
120
123
yc .SlackOverflow .LogLevel = strings .TrimSpace (logLevel )
121
124
122
- // Number of questions to watch
123
- std .Hr ()
124
- std .Body ("Set the value for how many latest questions you want to track and update." )
125
- std .Body ("Good value is (25) which means that besides checking new qustions in defined stack exchange site" )
126
- std .Body ("also last (n) questions will be checked for comment count, view count, answer count, score and is question accepted or not." )
127
- std .Body ("Emoijs of these stats will be removed from older than (n) questions." )
128
- std .Hr ()
129
- fmt .Scan (& yc .SlackOverflow .Watch )
130
125
yc .Save ()
131
126
Ok ("Slack Overflow is configured" )
132
127
std .Hr ()
@@ -157,7 +152,7 @@ func (yc *yamlContents) ConfigureStackExchange() {
157
152
std .Body ("For full list of available sites check: http://stackexchange.com/sites" )
158
153
std .Hr ()
159
154
site , _ := reader .ReadString ('\n' )
160
- yc .StackExchange .SearchAdvanced [ "site" ] = strings .TrimSpace (site )
155
+ yc .StackExchange .Site = strings .TrimSpace (site )
161
156
162
157
// Set tagged parameter value for Stack Exchange search advanced
163
158
std .Hr ()
@@ -167,6 +162,15 @@ func (yc *yamlContents) ConfigureStackExchange() {
167
162
tagged , _ := reader .ReadString ('\n' )
168
163
yc .StackExchange .SearchAdvanced ["tagged" ] = strings .TrimSpace (tagged )
169
164
165
+ // Number of questions to watch
166
+ std .Hr ()
167
+ std .Body ("Set the value for how many latest questions you want to track and update." )
168
+ std .Body ("Good value is (25) which means that besides checking new qustions in defined stack exchange site" )
169
+ std .Body ("also last (n) questions will be checked for comment count, view count, answer count, score and is question accepted or not." )
170
+ std .Body ("Emoijs of these stats will be removed from older than (n) questions." )
171
+ std .Hr ()
172
+ fmt .Scan (& yc .StackExchange .QuestionsToWatch )
173
+
170
174
// stackexchange clientKey
171
175
std .Hr ()
172
176
std .Body ("Without having Stack Exchange API APP key's you can make 300 requests per day." )
0 commit comments