@@ -0,0 +1,1968 @@
+package handlers;%0A%0Aimport com.github.masahitojp.botan.Robot;%0Aimport com.github.masahitojp.botan.handler.BotanMessageHandlers;%0Aimport org.apache.http.client.utils.URIBuilder;%0Aimport org.jsoup.Jsoup;%0Aimport org.jsoup.nodes.Document;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.io.IOException;%0Aimport java.net.URISyntaxException;%0A%0A@SuppressWarnings(%22unused%22)%0Apublic class BizwdHandlers implements BotanMessageHandlers %7B%0A%09private static Logger log = LoggerFactory.getLogger(BizwdHandlers.class);%0A%09private static String BASE_SCHEME = %22http%22;%0A%09private static String BASE_HOST = %22bizwd.net%22;%0A%09private static String BASE_PATH = %22/%22;%0A%09private static String ERROR_PREFIX = %22bizwd request failed : %22;%0A%0A%09@Override%0A%09public void register(Robot robot) %7B%0A%09%09robot.respond(%0A%09%09%09%09%22(bizwd%7Cb) (?%3Cbody%3E.+)%22,%0A%09%09%09%09%22brush up your text by bizwd%22,%0A%09%09%09%09message -%3E %7B%0A%09%09%09%09%09final String word = message.getMatcher().group(%22body%22);%0A%09%09%09%09%09try %7B%0A%09%09%09%09%09%09final String bizwdWord = bizwd(word);%0A%09%09%09%09%09%09log.info(%22bizwd : %22, bizwdWord);%0A%09%09%09%09%09%09message.reply(bizwdWord);%0A%09%09%09%09%09%7D catch (final URISyntaxException e) %7B%0A%09%09%09%09%09%09log.warn(%22URISyntax exception.%22, e);%0A%09%09%09%09%09%09message.reply(ERROR_PREFIX + e.getMessage());%0A%09%09%09%09%09%7D catch (final IOException e) %7B%0A%09%09%09%09%09%09log.warn(%22IOException.%22, e);%0A%09%09%09%09%09%09message.reply(ERROR_PREFIX + e.getMessage());%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09);%0A%09%7D%0A%0A%09/**%0A%09 * %E5%85%A5%E5%8A%9B%E3%81%95%E3%82%8C%E3%81%9F%E8%A8%80%E8%91%89%E3%82%92%E3%83%93%E3%82%B8%E3%83%8D%E3%83%83%E3%82%B7%E3%83%A5%E5%8C%96%E3%81%97%E3%81%A6%E8%BF%94%E3%81%99%0A%09 * @param word word%0A%09 * @return bizwd%0A%09 * @throws URISyntaxException URISyntaxException%0A%09 * @throws IOException IOException%0A%09 */%0A%09private static String bizwd(final String word) throws URISyntaxException, IOException %7B%0A%09%09final String url = new URIBuilder()%0A%09%09%09%09.setScheme(BASE_SCHEME)%0A%09%09%09%09.setHost(BASE_HOST)%0A%09%09%09%09.setPath(BASE_PATH).build().toString();%0A%0A%09%09final Document document = Jsoup.connect(url)%0A%09%09%09%09.data(%22before%22, word)%0A%09%09%09%09.data(%22after%22, word)%0A%09%09%09%09.data(%22level%22, %222%22)%0A%09%09%09%09.data(%22transbtn%22, %22%E7%BF%BB%E8%A8%B3%22)%0A%09%09%09%09.post();%0A%09%09log.info(document.toString());%0A%09%09return document.select(%22%5Bname=after%5D%22).text();%0A%09%7D%0A%7D%0A

improve #129 ビジネッシュ機能