diff --git a/tools/buttfeed.py b/tools/buttfeed.py index 5c0316b5..20e8e541 100755 --- a/tools/buttfeed.py +++ b/tools/buttfeed.py @@ -3,6 +3,7 @@ import argparse import feedparser import json +import re import subprocess import time @@ -28,7 +29,11 @@ def get_entries(): for name, url in k_feeds.items(): feed = feedparser.parse(url) for entry in feed.entries: - results.append((time.mktime(entry.get('updated_parsed')), name, entry.link, fix_title(entry))) + if entry.summary.startswith('.*?$\s*^([^\n]+)$', entry.summary, re.S | re.M): + results.append((time.mktime(entry.get('updated_parsed')), name, m[0], m[1])) + else: + results.append((time.mktime(entry.get('updated_parsed')), name, entry.link, entry.title.split('\n')[0])) results.sort() results.reverse() return results