Exemple #1
0
def feeder_sites_info():
    feed_sites = feedcore.read_data("general")
    news_sites = feedcore.read_data("news")
    podcasts_sites = feedcore.read_data("podcasts")
    newsletter_feeds = feedcore.read_data("newsletters")
    return render_template(
        "feeders.html",
        feed_sites=feed_sites,
        news_sites=news_sites,
        podcasts_sites=podcasts_sites,
        newsletter_feeds=newsletter_feeds,
        total=len(feed_sites) + len(podcasts_sites) + len(newsletter_feeds) +
        len(news_sites),
    )
Exemple #2
0
def news_feed():
    filter_feed = request.args.get("filter", default="*", type=str)
    data_keys = feedcore.read_data("news")
    data_keys = [item["name"] for item in data_keys]
    if filter_feed == "*":
        data = feedcore.news_feed(True)
        return render_template("news.html",
                               news_feed_data=data,
                               feeder_sites=data_keys)
    else:
        for item in feedcore.read_data("news"):
            if item["name"] == filter_feed:
                data = feedcore.feed(item["link"])
                return render_template(
                    "news.html",
                    news_feed_data=data,
                    feeder_sites=data_keys,
                    filterfeed=filter_feed,
                    filterfeed_link=item["web"],
                )
    return render_template("error.html", server_error=500)
Exemple #3
0
 def test_run_podcasts(self):
     self.assertIsNotNone(feedcore.read_data("podcasts"))
Exemple #4
0
 def test_run_newsletters(self):
     self.assertIsNotNone(feedcore.read_data("newsletters"))
Exemple #5
0
 def test_run_general(self):
     self.assertIsNotNone(feedcore.read_data("general"))