- private static Map<Category, String[]> getFeeds() {
- Map<Category, String[]> result;
-
- result = new HashMap<>();
-
- result.put(Category.TOP,
- new String[] {
- "http://www.francetvinfo.fr/titres.rss",
- "http://www.rfi.fr/general/rss",
- "http://www.cnews.fr/rss/une",
- "http://www.ladepeche.fr/rss/a-la-une.rss",
- "https://www.franceinter.fr/rss/a-la-une.xml",
- "https://www.francebleu.fr/rss/a-la-une.xml",
- "http://www.bfmtv.com/rss/info/flux-rss/flux-toutes-les-actualites/"
- });
-
- result.put(Category.SPORT,
- new String[] { "http://www.france24.com/fr/sports/rss" });
-
- result.put(Category.FRANCE,
- new String[] { "http://www.france24.com/fr/france/rss",
- "http://www.rfi.fr/france/rss"});
-
- result.put(Category.EUROPE,
- new String[] { "http://www.france24.com/fr/europe/rss" });
-
- result.put(Category.MONDE,
- new String[] { "http://www.france24.com/fr/actualites/rss" });
-
+ private boolean exists(String articleLink, List<Article> articles) {
+ synchronized (articles) {
+ for (Article a: articles)
+ if (a.link.equals(articleLink))
+ return true;
+ }
+ return false;
+ }
+
+ private static Article toArticle(String link, SyndEntry entry, SyndFeed feed, String lang) {
+ String desc, title, thumbnail, feedTitle, str;
+ Date date;
+ String[] entities;
+
+ feedTitle = feed.getTitle();
+ if (feedTitle != null) {
+ feedTitle = feedTitle.trim();
+ }