git://git.nikiroo.be
/
gofetch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
64a785f
)
Fix bug due to 'id'-handling change
author
Niki Roo
<niki@nikiroo.be>
Fri, 7 Sep 2018 07:09:58 +0000
(09:09 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Fri, 7 Sep 2018 07:09:58 +0000
(09:09 +0200)
src/be/nikiroo/gofetch/support/BasicSupport.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/gofetch/support/LWN.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/gofetch/support/Phoronix.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/gofetch/support/Slashdot.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/gofetch/support/BasicSupport.java
b/src/be/nikiroo/gofetch/support/BasicSupport.java
index 80fe5d236d31c2379856a8245f09e80b4cfeab79..972852333fed4707ecd9ed2812e45c7f2ee00f8b 100644
(file)
--- a/
src/be/nikiroo/gofetch/support/BasicSupport.java
+++ b/
src/be/nikiroo/gofetch/support/BasicSupport.java
@@
-32,7
+32,7
@@
import be.nikiroo.utils.StringUtils;
*/
public abstract class BasicSupport {
/** The downloader to use for all websites. */
*/
public abstract class BasicSupport {
/** The downloader to use for all websites. */
-
protected static
Downloader downloader = new Downloader("gofetcher");
+
static protected
Downloader downloader = new Downloader("gofetcher");
static private String preselector;
static private String preselector;
@@
-106,7
+106,11
@@
public abstract class BasicSupport {
continue;
}
continue;
}
- if (id.isEmpty()) {
+ if (!id.isEmpty()) {
+ while (id.length() < 10) {
+ id = "0" + id;
+ }
+ } else {
id = date.replace(":", "_").replace("+", "_");
}
id = date.replace(":", "_").replace("+", "_");
}
diff --git
a/src/be/nikiroo/gofetch/support/LWN.java
b/src/be/nikiroo/gofetch/support/LWN.java
index eac12e5c239c37aa921d2945333d1b7fbc4c4e9a..144fdc90514039656168bf41fef8b850a027d4fe 100644
(file)
--- a/
src/be/nikiroo/gofetch/support/LWN.java
+++ b/
src/be/nikiroo/gofetch/support/LWN.java
@@
-53,12
+53,7
@@
public class LWN extends BasicSupport {
@Override
protected String getArticleId(Document doc, Element article) {
@Override
protected String getArticleId(Document doc, Element article) {
- String id = getArticleIntUrl(doc, article).replaceAll("[^0-9]", "");
- while (id.length() < 10) {
- id = "0" + id;
- }
-
- return id;
+ return getArticleIntUrl(doc, article).replaceAll("[^0-9]", "");
}
@Override
}
@Override
diff --git
a/src/be/nikiroo/gofetch/support/Phoronix.java
b/src/be/nikiroo/gofetch/support/Phoronix.java
index 5338cd639ff2ebe2435834336af1232320827ebf..8f257fbb0d7b3a36d17a8601a61fc3bfd3de6149 100644
(file)
--- a/
src/be/nikiroo/gofetch/support/Phoronix.java
+++ b/
src/be/nikiroo/gofetch/support/Phoronix.java
@@
-45,9
+45,6
@@
class Phoronix extends BasicSupport {
id = id.substring(pos + 1);
}
id = id.substring(pos + 1);
}
- while (id.length() < 10) {
- id = "0" + id;
- }
return id;
}
}
return id;
}
}
diff --git
a/src/be/nikiroo/gofetch/support/Slashdot.java
b/src/be/nikiroo/gofetch/support/Slashdot.java
index 6fb51a6dd32cb5f0bd37692165560ca1fdb915b9..43ce13d023ff498d3a759e9eac884f351d10e79a 100644
(file)
--- a/
src/be/nikiroo/gofetch/support/Slashdot.java
+++ b/
src/be/nikiroo/gofetch/support/Slashdot.java
@@
-45,10
+45,6
@@
public class Slashdot extends BasicSupport {
id = id.substring("title-".length());
}
id = id.substring("title-".length());
}
- while (id.length() < 10) {
- id = "0" + id;
- }
-
return id;
}
return id;
}