From d71af2078aa1e33613eb912cd415db120c0b7e25 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 10 Nov 2020 18:57:35 +0530 Subject: [PATCH] simplified markdown conversion --- main.py | 61 --------------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/main.py b/main.py index fdbc542..d994577 100644 --- a/main.py +++ b/main.py @@ -121,67 +121,6 @@ if markdown: mdfile.new_table_of_contents(table_title='Contents', depth=2) mdfile.create_md_file() -if not markdown: - mdfile = MdUtils(file_name=title,title='Daily Dose') - mdfile.new_line('\n') - for feed in rss_feeds: - Ignore = [] - ReadSummary = True - URL = None - ToRead = 5 - try: - URL = feeds[feed]["URL"] - except KeyError: - print("Improper configuration for %s. No URL Specified") - exit(1) - try: - Ignore = eval(feeds[feed]["IGNORE"]) - except KeyError: - None - try: - ReadSummary = eval(feeds[feed]["SUMMARY"]) - except KeyError: - ReadSummary = True - try: - ToRead = eval(feeds[feed]["ToRead"]) - except: - None - - rss = feedparser.parse(URL) - maximum = len(rss.entries) - - count = 0 - - if ToRead == -1: - ToRead = maximum - - #print("## From %s:" % feed,end="\n\n") - mdfile.new_header(level=1, title="From %s" % feed) - - while count != ToRead: - NoSkip = True - Title = rss.entries[count].title - summary = rss.entries[count].summary - for words in Ignore: - if (words.lower() in Title.lower()) or (words.lower() in summary.lower()): - NoSkip = False - break - if NoSkip: - #print(title) - mdfile.write(str("* **"+Title+"**")) - if ReadSummary: - #print(summary) - mdfile.write(" - ") - mdfile.write(summary) - mdfile.write("\n\n") - else: - mdfile.write("\n") - - count += 1 - mdfile.new_line('\n') - mdfile.new_table_of_contents(table_title='Contents', depth=2) - mdfile.create_md_file() - import pypandoc