@@ -0,0 +1,1617 @@
+//Filter for retrieving body html tag + removing inner tags%0A%0Apackage udf_KW;%0A%0Aimport java.io.IOException;%0Aimport java.util.Arrays;%0A%0Aimport org.apache.pig.EvalFunc;%0Aimport org.apache.pig.data.Tuple;%0A%0Aimport java.util.regex.Pattern;%0Aimport java.util.regex.Matcher;%0A%0Apublic class Get_Body extends EvalFunc%3CString%3E %7B%0A%0A%09@Override%0A%09public String exec(Tuple input) throws IOException%0A%09%7B%0A%09%09String output = %22%22;%0A%09%09if(input != null && !input.isNull())%0A%09%09%7B%0A%09%09%09String _html = (String)input.get(0);%0A%09%09%09if(_html != null && !_html.isEmpty())%0A%09%09%09%7B%0A%09%09%09%09output = _html;%0A%09%09%09%09int start_index = _html.indexOf(%22%3Cbody%22);%0A%09%09%09%09start_index += 5;%0A%09%09%09%09int stop_index = _html.indexOf(%22%3C/body%22);%0A%09%09%09%09if(start_index %3E= 0 && start_index %3C _html.length() && stop_index %3E= start_index && stop_index %3C _html.length())%0A%09%09%09%09%09output = _html.substring(start_index,stop_index);%0A%09%09%09%09Pattern REMOVE_TAGS = Pattern.compile(%22%3C.+?%3E%22);%0A%09%09%09%09Matcher m = REMOVE_TAGS.matcher(output);%0A%09%09%09%09output = m.replaceAll(%22%22);%0A%09%09%09%09REMOVE_TAGS = Pattern.compile(%22%3C!--(.+?)--%3E%22);%0A%09%09%09%09m = REMOVE_TAGS.matcher(output);%0A%09%09%09%09output = m.replaceAll(%22%22);%0A/*%09%09%09%09boolean intag = false;%0A%09%09%09%09String inp = output;%0A%09%09%09%09String outp = %22%22;%0A%0A%09%09%09%09for (int i=0; i %3C inp.length(); ++i)%0A%09%09%09%09%7B%0A%09%09%09%09    if (!intag && inp.charAt(i) == '%3C')%0A%09%09%09%09    %7B%0A%09%09%09%09        intag = true;%0A%09%09%09%09        continue;%0A%09%09%09%09    %7D%0A%09%09%09%09    if (intag && inp.charAt(i) == '%3E')%0A%09%09%09%09    %7B%0A%09%09%09%09        intag = false;%0A%09%09%09%09        continue;%0A%09%09%09%09    %7D%0A%09%09%09%09    if (!intag)%0A%09%09%09%09    %7B%0A%09%09%09%09        outp = outp + inp.charAt(i);%0A%09%09%09%09    %7D%0A%09%09%09%09%7D%0A%09%09%09%09output = outp;%0A//%09%09%09%09output = output.replaceAll(%22%5C%5Cs+%22,%22%22);%0A*/%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return output;%0A%09%7D%0A%7D%0A

Create Get_Body.java