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), )
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)
def test_run_podcasts(self): self.assertIsNotNone(feedcore.read_data("podcasts"))
def test_run_newsletters(self): self.assertIsNotNone(feedcore.read_data("newsletters"))
def test_run_general(self): self.assertIsNotNone(feedcore.read_data("general"))