.cache -> gophermap
authorNiki Roo <niki@nikiroo.be>
Sun, 20 Aug 2017 11:13:31 +0000 (13:13 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 20 Aug 2017 11:13:31 +0000 (13:13 +0200)
src/be/nikiroo/gofetch/Fetcher.java
src/be/nikiroo/gofetch/output/Gopher.java

index 7490037c201929aba38297d809e7f9c917af1e95..7866fe0030acc87c73dc2775ff2fb432bf50a11a 100644 (file)
@@ -100,7 +100,7 @@ public class Fetcher {
                File gopherCache = new File(dir, preselector);
                gopherCache.mkdirs();
                File htmlIndex = new File(gopherCache, "index.html");
-               gopherCache = new File(gopherCache, ".cache");
+               gopherCache = new File(gopherCache, "gophermap");
 
                Output gopher = new Gopher(null, hostname, preselector, port);
                Output html = new Html(null, hostname, preselector, port);
@@ -198,12 +198,12 @@ public class Fetcher {
                        if (enoughStories || last) {
                                if (!last) {
                                        gopherLines.add(getLink("More", support.getSelector()
-                                                       + ".cache_" + (page + 1), false, false));
+                                                       + "gophermap_" + (page + 1), false, false));
                                        htmlLines.add(getLink("More", "index_" + (page + 1)
                                                        + ".html", false, true));
                                }
 
-                               write(gopherLines, varDir, ".cache", "", page);
+                               write(gopherLines, varDir, "gophermap", "", page);
                                write(htmlLines, varDir, "index", ".html", page);
                                gopherLines = new ArrayList<String>();
                                htmlLines = new ArrayList<String>();
@@ -230,7 +230,7 @@ public class Fetcher {
        private String getLink(String name, String ref, boolean index, boolean html) {
                if (!html) {
                        return new StringBuilder().append("1" + name).append("\t")
-                                       .append((index ? "1" : "0") + ref) //
+                                       .append(ref) //
                                        .append("\t").append(hostname) //
                                        .append("\t").append(Integer.toString(port)) //
                                        .append("\r\n").toString();
index dd5e3482f3c18b487097b595709cc211b3f8082b..3fa6035c328d3f0731f5bc3a81ce7e38f3220abb 100644 (file)
@@ -101,7 +101,7 @@ public class Gopher extends Output {
                        appendJustified(builder, story.getFullContent(), "    ");
                } else {
                        builder.append('1').append(story.getTitle()) //
-                                       .append('\t').append("0").append(story.getSelector()) //
+                                       .append('\t').append(story.getSelector()) //
                                        .append('\t').append(hostname) //
                                        .append('\t').append(port) //
                                        .append("\r\n");