X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2Fsupport%2FBasicSupport.java;h=9555b9db363a2bdffe408d1698db0bb35f73d380;hb=21f1a997d7addd93226243b0d6d80ce8afcde153;hp=42761c9a82d1a7cd39bcd3bc96dd46e862f608a2;hpb=3367f6256b5143b7cba2a61de36e74f389a5f379;p=gofetch.git diff --git a/src/be/nikiroo/gofetch/support/BasicSupport.java b/src/be/nikiroo/gofetch/support/BasicSupport.java index 42761c9..9555b9d 100644 --- a/src/be/nikiroo/gofetch/support/BasicSupport.java +++ b/src/be/nikiroo/gofetch/support/BasicSupport.java @@ -3,7 +3,6 @@ package be.nikiroo.gofetch.support; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -34,7 +33,7 @@ import be.nikiroo.utils.StringUtils; */ public abstract class BasicSupport { /** - * The downloader to use for all web sites via + * The {@link Downloader} to use for all web sites via * {@link BasicSupport#open(URL)} */ static private Downloader downloader = new Downloader("gofetcher"); @@ -56,6 +55,7 @@ public abstract class BasicSupport { * in case of I/O error * */ + @SuppressWarnings("unused") public void login() throws IOException { } @@ -133,7 +133,8 @@ public abstract class BasicSupport { id = "0" + id; } } else { - id = date.replace(":", "_").replace("+", "_"); + id = date.replace(":", "_").replace("+", "_") + .replace("/", "-"); } date = date(date); @@ -577,9 +578,6 @@ public abstract class BasicSupport { case SLASHDOT: support = new Slashdot(); break; - case PIPEDOT: - support = new Pipedot(); - break; case LWN: support = new LWN(); break; @@ -601,6 +599,9 @@ public abstract class BasicSupport { case SEPT_SUR_SEPT: support = new SeptSurSept(); break; + case REDDIT: + support = new Reddit(); + break; } if (support != null) { @@ -819,7 +820,7 @@ public abstract class BasicSupport { Date dat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX") .parse(date.trim()); return out.format(dat); - } catch (ParseException e) { + } catch (Exception e) { return date; } }