Commit 2260d4fe authored by Thibault Ehrhart's avatar Thibault Ehrhart

Do not convert articles with certain keywords ("Agenda", "Advisory", "COMMUNIQUÉ-BUSINESS-WIRE")

parent a2f33b0a
......@@ -111,6 +111,14 @@ public class AgenceFrancePresse {
NewsArticle article =
AgenceFrancePresseMethods.parseArticle(
inputFactory.createXMLStreamReader(in));
if (!Collections.disjoint(
article.getKeywords(),
Arrays.asList("Agenda", "Advisory", "COMMUNIQUÉ-BUSINESS-WIRE"))) {
// Ignore articles with certain keywords
System.out.println(
"Skip article with Agenda/Advisory/Business Wire: " + article.getId());
return;
}
List<ImageObject> images = AgenceFrancePresseMethods.getArticleImages(article);
images.forEach(article::addAssociatedMedia);
newsArticles.add(article);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment