import com.google.gson.JsonObject;
import com.rometools.rome.io.FeedException;
-import pnews.Article;
-import pnews.Category;
+import net.wpitchoune.pnews.Article;
+import net.wpitchoune.pnews.ArticleStore;
+import net.wpitchoune.pnews.Category;
+import net.wpitchoune.pnews.Config;
public class JSON {
private static final Logger LOG = Logger.getLogger(JSON.class.getName());
allArticles = ArticleStore.singleton.getArticles();
for (Article a: allArticles)
- if (a.readCount.get() > 0)
- jreadcounts.addProperty(a.link, a.readCount);
+ if (a.getReadCount() > 0)
+ jreadcounts.addProperty(a.getLink(), a.getReadCount());
jcategories = new JsonObject();
jstats.add("categories", jcategories);
for (Category cat: config.getCategories())
try {
- articles = provider.getArticles(cat);
+ articles = provider.getArticles(cat, null);
jcategories.addProperty(cat.getLabel(),
articles.size());
} catch (IllegalArgumentException | FeedException | IOException e) {