mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
store normalized urls
This commit is contained in:
@@ -87,11 +87,25 @@ public class FeedUtils {
|
||||
return encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the url. The resulting url is not meant to be used but rather
|
||||
* as a mean to identify a feed and avoid duplicates
|
||||
*/
|
||||
public static String normalizeURL(String url) {
|
||||
if (url == null) {
|
||||
return null;
|
||||
}
|
||||
return URLCanonicalizer.getCanonicalURL(url);
|
||||
String normalized = URLCanonicalizer.getCanonicalURL(url);
|
||||
if (normalized == null) {
|
||||
return url;
|
||||
}
|
||||
normalized = normalized.toLowerCase();
|
||||
|
||||
if (normalized.startsWith("https")) {
|
||||
normalized = "http" + normalized.substring(5);
|
||||
}
|
||||
normalized = normalized.replace("feeds2.feedburner.com", "feeds.feedburner.com");
|
||||
return normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user