@@ -0,0 +1,1435 @@
+package google.finder;%0A%0Aimport java.io.IOException;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0Aimport org.jsoup.Jsoup;%0Aimport org.jsoup.nodes.Document;%0Aimport org.springframework.stereotype.Component;%0A%0A@Component%0Aclass GoogleConnector %7B%0A%0A%09private static final Logger log = LogManager.getLogger(GoogleConnector.class);%0A%0A%09private static final String USER_AGENT = %22Mozilla/5.0 (X11; Linux x86_64) %22%0A%09%09%09+ %22AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/%22%0A%09%09%09+ %2258.0.3029.81 Chrome/58.0.3029.81 Safari/537.36%22;%0A%0A%09private static final String REGEX_RESULTS = %22Oko%C5%82o(.*)wynik%C3%B3w%22;%0A%0A%09long getNumberOfResults(String query) %7B%0A%09%09final Document page;%0A%09%09try %7B%0A%09%09%09page = getPage(query);%0A%09%09%09log.debug(%22Pobrano stron%C4%99 dla zapytania '%7B%7D'.%22, query);%0A%09%09%7D catch (IOException ioe) %7B%0A%09%09%09log.error(%22B%C5%82%C4%85d pobierania strony dla zapytania '%7B%7D'.%22, query);%0A%09%09%09throw new FinderException(%22B%C5%82%C4%85d pobierania strony dla zapytania %22 + query, ioe);%0A%09%09%7D%0A%0A%09%09Matcher matcher = Pattern.compile(REGEX_RESULTS)%0A%09%09%09%09.matcher(page.select(%22div#resultStats%22).text());%0A%0A%09%09if (matcher.find()) %7B%0A%09%09%09return Long.parseLong(matcher.group(1).replaceAll(%22%5C%5CD%22, %22%22));%0A%09%09%7D else %7B%0A%09%09%09return 0;%0A%09%09%7D%0A%09%7D%0A%0A%09Document getPage(String query) throws IOException %7B%0A%09%09return Jsoup.connect(%22https://google.pl/search?q=%22 + query.replace(' ', '+'))%0A%09%09%09%09.userAgent(USER_AGENT)%0A%09%09%09%09.get();%0A%09%7D%0A%0A%7D%0A

Add GoogleConnector component.