From: Niki Roo Date: Mon, 7 Aug 2017 10:14:00 +0000 (+0200) Subject: Limit to 67 chars, fix content for LWN (still WIP) X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=2527107526aea628df09c3ad53432e9a5480fcd7;p=gofetch.git Limit to 67 chars, fix content for LWN (still WIP) --- diff --git a/src/be/nikiroo/gofetch/output/Gopher.java b/src/be/nikiroo/gofetch/output/Gopher.java index 10714b1..1ad9731 100644 --- a/src/be/nikiroo/gofetch/output/Gopher.java +++ b/src/be/nikiroo/gofetch/output/Gopher.java @@ -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); diff --git a/src/be/nikiroo/gofetch/support/LWN.java b/src/be/nikiroo/gofetch/support/LWN.java index 869380d..e25bc92 100644 --- a/src/be/nikiroo/gofetch/support/LWN.java +++ b/src/be/nikiroo/gofetch/support/LWN.java @@ -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 ");