refactoring

pull/2/head
Vyacheslav N. Boyko 2018-02-08 10:54:56 +03:00
parent 7a44a268b5
commit 38071b27e0
3 changed files with 7 additions and 28 deletions

3
.gitignore vendored
View File

@ -48,6 +48,3 @@ yandex-search.txt
target
jircbot.sqlite
config.json

View File

@ -5,26 +5,8 @@
"enabled" : true,
"server" : "irc.freenode.net",
"port" : 6667,
"channelsNames" : ["#voidforum", "#lor"],
"botName" : "jircbot"
"channelsNames" : ["#voidforum"],
"botName" : "jircbot-test"
}
],
"settings" : {
"doodle" : {
"mainUrl" : "https://www.google.com",
"checkUrl" : "https://www.google.com/doodles",
"linkSelector" : "li.latest-doodle.on .container a",
"titleSelector" : "li.latest-doodle.on .container input.title",
"dateSelector" : "li.latest-doodle.on .container input.tag"
},
"search" : {
"uuid" : "YOUR_UUID",
"appKey" : "YOUR_APP_KEY"
},
"yaSearch" : {
"url" : "https://yandex.ru/search/xml?",
"user" : "USER_NAME",
"key" : "YOUR_KEY"
}
}
]
}

View File

@ -59,10 +59,10 @@ public class JircBotConfiguration {
this.connections.add(config);
}
JSONObject lstnrSettings = (JSONObject) jsonObject.get("settings");
this.listenersSettings.put(KEY_GOOGLE_DOODLE, this.readGoogleDoodleSettings(lstnrSettings));
this.listenersSettings.put(KEY_GOOGLE_SEARCH, this.readGoogleSearchSettings(lstnrSettings));
this.listenersSettings.put(KEY_YANDEX_SEARCH, this.readYandexSearchSettings(lstnrSettings));
// JSONObject lstnrSettings = (JSONObject) jsonObject.get("settings");
// this.listenersSettings.put(KEY_GOOGLE_DOODLE, this.readGoogleDoodleSettings(lstnrSettings));
// this.listenersSettings.put(KEY_GOOGLE_SEARCH, this.readGoogleSearchSettings(lstnrSettings));
// this.listenersSettings.put(KEY_YANDEX_SEARCH, this.readYandexSearchSettings(lstnrSettings));
} catch (FileNotFoundException e) {
e.printStackTrace();