load feeds configuration from json
[pnews.git] / war / src / main / java / pnews / servlet / ArticleProvider.java
index 1dece09..48c551b 100644 (file)
@@ -47,68 +47,7 @@ public class ArticleProvider {
                 return new SyndFeedInput().build(r);                
         }
         
-        private static Map<Category, String[]> getFeeds() {
-                Map<Category, String[]> 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<Article> getArticlesForUpdate(Category cat) {
                 List<Article> 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)