diff --git a/library/SjpApi.jar b/library/SjpApi.jar index b373da1..ef8a266 100644 Binary files a/library/SjpApi.jar and b/library/SjpApi.jar differ diff --git a/src/CurlHelper.java b/src/CurlHelper.java index 36d46ce..9fd86cb 100644 --- a/src/CurlHelper.java +++ b/src/CurlHelper.java @@ -1,10 +1,6 @@ package com.sjp.sjpapi; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URL; public class CurlHelper { @@ -20,7 +16,7 @@ public static String getOutputFromCurl(String word) throws IOException { String outputFromCurl = readCurlFromSJP(word); if (validator.isCurlValidate(outputFromCurl) == true) { - return wrapper.deleteHeadFromOutput(outputFromCurl); + return wrapper.getBettwenH1AndCommentSection(outputFromCurl); } return ""; } diff --git a/src/CurlWrapper.java b/src/CurlWrapper.java index fc9f27f..bfb3fe6 100644 --- a/src/CurlWrapper.java +++ b/src/CurlWrapper.java @@ -3,18 +3,18 @@ public class CurlWrapper { public String wrappCurl(String curlOutput) { - return deleteHeadFromOutput(curlOutput); + return getBettwenH1AndCommentSection(curlOutput); } - public String deleteHeadFromOutput(String curlOutput) { + public String getBettwenH1AndCommentSection(String curlOutput) { - String outputWithoutHeadSection = curlOutput; + String outputBettwenH1AndComment = curlOutput; - String bodySectionStart = "
"; - String bodySectionFinis = ""; - outputWithoutHeadSection = StringUtils.substringBettwen(outputWithoutHeadSection,bodySectionStart,bodySectionFinis); + String h1SectionStart = "