Limit to 67 chars, fix content for LWN (still WIP)
authorNiki Roo <niki@nikiroo.be>
Mon, 7 Aug 2017 10:14:00 +0000 (12:14 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 7 Aug 2017 10:14:00 +0000 (12:14 +0200)
src/be/nikiroo/gofetch/output/Gopher.java
src/be/nikiroo/gofetch/support/LWN.java

index 10714b171235332ac30f88a8ffbd14932e176504..1ad9731ccf1308fbf9f4c650783dd10e6da5044e 100644 (file)
@@ -8,7 +8,7 @@ import be.nikiroo.gofetch.data.Story;
 import be.nikiroo.gofetch.support.BasicSupport.Type;
 
 public class Gopher extends Output {
-       static private final int LINE_SIZE = 70;
+       static private final int LINE_SIZE = 67;
 
        public Gopher(Type type, String hostname, String preselector, int port) {
                super(type, hostname, preselector, port);
index 869380dd03ec4c4ab0cb14b6c08d4614141c16ab..e25bc92d519ed0d340b2d99695bfc167164ff5bf 100644 (file)
@@ -54,7 +54,13 @@ public class LWN extends BasicSupport {
 
                        String title = titles.get(0).text();
                        String details = listing.children().get(0).text();
-                       String body = listing.children().get(1).text();
+                       String body = "";
+                       // All but the first and two last children
+                       for (int i = 1 ; i < listing.children().size() - 2; i++) {
+                               Element e = listing.children().get(i);
+                               body = body.trim() + " " + e.text().trim();
+                       }
+                       body = body.trim();
                        
                        String author = "";
                        int pos = details.indexOf(" by ");