From 38071b27e03add674615e0b4412f9eac5b88645b Mon Sep 17 00:00:00 2001 From: "Vyacheslav N. Boyko" Date: Thu, 8 Feb 2018 10:54:56 +0300 Subject: [PATCH] refactoring --- .gitignore | 3 --- config.json | 24 +++---------------- .../jircbot/config/JircBotConfiguration.java | 8 +++---- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 4c323d7..ff5e494 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,3 @@ yandex-search.txt target -jircbot.sqlite - -config.json \ No newline at end of file diff --git a/config.json b/config.json index faf6769..40cf81d 100644 --- a/config.json +++ b/config.json @@ -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" - } - } + ] } \ No newline at end of file diff --git a/src/main/java/ru/bvn13/jircbot/config/JircBotConfiguration.java b/src/main/java/ru/bvn13/jircbot/config/JircBotConfiguration.java index a4a747b..f0750d9 100644 --- a/src/main/java/ru/bvn13/jircbot/config/JircBotConfiguration.java +++ b/src/main/java/ru/bvn13/jircbot/config/JircBotConfiguration.java @@ -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();