Merge branch 'master' of github.com:nikiroo/gofetch
authorNiki Roo <niki@nikiroo.be>
Fri, 28 Sep 2018 10:50:10 +0000 (12:50 +0200)
committerNiki Roo <niki@nikiroo.be>
Fri, 28 Sep 2018 10:50:10 +0000 (12:50 +0200)
1  2 
src/be/nikiroo/gofetch/support/SeptSurSept.java

index efe87cd0e980ea9bfe45fbd706ffb2df8bcc8f50,7f5ca1657a7513815511b931cca72fd178d799bc..35bf34a2bcd9caef64f6a160e2455262e0eccfcd
@@@ -1,7 -1,9 +1,9 @@@
  package be.nikiroo.gofetch.support;
  
  import java.io.IOException;
+ import java.io.UnsupportedEncodingException;
  import java.net.URL;
+ import java.net.URLDecoder;
  import java.util.AbstractMap;
  import java.util.ArrayList;
  import java.util.List;
@@@ -19,7 -21,7 +21,7 @@@ import org.jsoup.nodes.Node
  public class SeptSurSept extends BasicSupport {
        @Override
        public String getDescription() {
 -              return "7SUR7.be Info, sport et showbiz, 24/24, 7/7";
 +              return "7sur7.be: Info, sport et showbiz, 24/24, 7/7";
        }
  
        @Override
  
        @Override
        protected String getArticleTitle(Document doc, Element article) {
-               return article.attr("data-title");
+               try {
+                       return URLDecoder.decode(article.attr("data-title"), "UTF-8");
+               } catch (UnsupportedEncodingException e) {
+                       throw new RuntimeException("UTF-8 support mandatory in JVM");
+               }
        }
  
        @Override
  
        @Override
        protected String getArticleContent(Document doc, Element article) {
-               return article.attr("data-intro").trim();
+               try {
+                       return URLDecoder.decode(article.attr("data-intro"), "UTF-8")
+                                       .trim();
+               } catch (UnsupportedEncodingException e) {
+                       throw new RuntimeException("UTF-8 support mandatory in JVM");
+               }
        }
  
        @Override
  
        @Override
        protected ElementProcessor getElementProcessorComment() {
-               return null;
+               return new BasicElementProcessor();
        }
  }