X-Git-Url: https://wpitchoune.net/gitweb/?a=blobdiff_plain;f=war%2Fsrc%2Fmain%2Fjava%2Fpnews%2Fservlet%2FArticleProvider.java;h=48c551b277ba6ebbdcd9797a02881e1b17521134;hb=27591c1933180a43423c78cc8cda28a3da1bfccf;hp=1dece09c19970607c6dd36571ad6858f2854bccf;hpb=9dd396afa60532248fc053ef6063f7b602d58f36;p=pnews.git diff --git a/war/src/main/java/pnews/servlet/ArticleProvider.java b/war/src/main/java/pnews/servlet/ArticleProvider.java index 1dece09..48c551b 100644 --- a/war/src/main/java/pnews/servlet/ArticleProvider.java +++ b/war/src/main/java/pnews/servlet/ArticleProvider.java @@ -47,68 +47,7 @@ public class ArticleProvider { return new SyndFeedInput().build(r); } - private static Map getFeeds() { - Map result; - - result = new HashMap<>(); - - result.put(Category.TOP, - new String[] { - "http://www.europe1.fr/var/export/rss/europe1/actus.xml", - "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.europe1.fr/var/export/rss/europe1/sport.xml", - "http://www.sportune.fr/feed", - "http://www.france24.com/fr/sports/rss" }); - - result.put(Category.FRANCE, - new String[] { "http://www.france24.com/fr/france/rss", - "http://www.francetvinfo.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.europe1.fr/var/export/rss/europe1/international.xml", - "http://www.france24.com/fr/actualites/rss" }); - - - result.put(Category.ECO, - new String[] { "http://www.france24.com/fr/economie/rss", - "http://www.europe1.fr/var/export/rss/europe1/economie.xml", - "http://www.rfi.fr/economie/rss" }); - - result.put(Category.ESSONNE, - new String[] { "http://www.tourisme-essonne.com/rss/actus/", - "http://www.ville-palaiseau.fr/rss/actualites.htm" }); - - result.put(Category.PEOPLE, - new String[] { "http://www.premiere.fr/rss/actu-live", - "http://www.purepeople.com/rss/news_t0.xml" - }); - - result.put(Category.TECHNOLOGIE, - new String[] { "http://www.generation-nt.com/export/rss.xml", - "http://www.europe1.fr/var/export/rss/europe1/sciences.xml", - "http://feeds.feedburner.com/lesnumeriques/news", - "http://www.zdnet.fr/feeds/rss/actualites/", - "http://www.frandroid.com/feed", - "http://www.silicon.fr/feed", - "http://www.fredzone.org/feed", - "http://www.futura-sciences.com/rss/actualites.xml", - "https://www-03.ibm.com/press/fr/fr/rssfeed.wss?keyword=null&maxFeed=&feedType=RSS&topic=all"}); - - return result; - } + private List
getArticlesForUpdate(Category cat) { List
result; @@ -214,7 +153,7 @@ public class ArticleProvider { private void retrieveArticles(Category cat) throws IllegalArgumentException, MalformedURLException, FeedException, IOException { String[] feeds; - feeds = getFeeds().get(cat); + feeds = Config.getFeedsByCategory().get(cat); if (feeds != null) for (String str: feeds)