@@ -16,7 +16,7 @@ import (
1616// Yaml mapping to yaml configuration
1717type yamlContents struct {
1818 SlackOverflow struct {
19- LogLevel string `yaml:"log_level "`
19+ LogLevel string `yaml:"log-level "`
2020 Watch int `yaml:"watch"`
2121 } `yaml:"slackoverflow"`
2222 Slack struct {
@@ -26,11 +26,14 @@ type yamlContents struct {
2626 APIHost string `yaml:"api-host"`
2727 } `yaml:"slack"`
2828 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"`
3437 } `yaml:"stackexchange"`
3538}
3639
@@ -119,14 +122,6 @@ func (yc *yamlContents) ConfigureSlackOverflow() {
119122 std .Hr ()
120123 yc .SlackOverflow .LogLevel = strings .TrimSpace (logLevel )
121124
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 )
130125 yc .Save ()
131126 Ok ("Slack Overflow is configured" )
132127 std .Hr ()
@@ -157,7 +152,7 @@ func (yc *yamlContents) ConfigureStackExchange() {
157152 std .Body ("For full list of available sites check: http://stackexchange.com/sites" )
158153 std .Hr ()
159154 site , _ := reader .ReadString ('\n' )
160- yc .StackExchange .SearchAdvanced [ "site" ] = strings .TrimSpace (site )
155+ yc .StackExchange .Site = strings .TrimSpace (site )
161156
162157 // Set tagged parameter value for Stack Exchange search advanced
163158 std .Hr ()
@@ -167,6 +162,15 @@ func (yc *yamlContents) ConfigureStackExchange() {
167162 tagged , _ := reader .ReadString ('\n' )
168163 yc .StackExchange .SearchAdvanced ["tagged" ] = strings .TrimSpace (tagged )
169164
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+
170174 // stackexchange clientKey
171175 std .Hr ()
172176 std .Body ("Without having Stack Exchange API APP key's you can make 300 requests per day." )
0 commit comments