mirror of
https://git.nolog.cz/NoLog.cz/headline.git
synced 2025-01-31 11:53:35 +01:00
limit messages to console
This commit is contained in:
parent
19aedaaa01
commit
df1d257438
1 changed files with 4 additions and 5 deletions
|
@ -48,8 +48,8 @@ def process_diff(old, new, rss_id):
|
||||||
diff = dmp.diff_main(old['title'], new['title'])
|
diff = dmp.diff_main(old['title'], new['title'])
|
||||||
dmp.diff_cleanupSemantic(diff)
|
dmp.diff_cleanupSemantic(diff)
|
||||||
html_diff = dmp.diff_prettyHtml(diff)
|
html_diff = dmp.diff_prettyHtml(diff)
|
||||||
print(old['link'])
|
# print(old['link'])
|
||||||
print(diff)
|
# print(diff)
|
||||||
|
|
||||||
sql = "INSERT INTO diffs(feed_name, article_url, title_orig, title_new, diff_html, diff_time) VALUES (?,?,?,?,?,datetime('now', 'localtime'))"
|
sql = "INSERT INTO diffs(feed_name, article_url, title_orig, title_new, diff_html, diff_time) VALUES (?,?,?,?,?,datetime('now', 'localtime'))"
|
||||||
sql_data = (old['medium'], old['link'], old['title'], new['title'], html_diff)
|
sql_data = (old['medium'], old['link'], old['title'], new['title'], html_diff)
|
||||||
|
@ -64,7 +64,7 @@ def process_item(article, rc):
|
||||||
old = json.loads(rc.get(article['rss_id']))
|
old = json.loads(rc.get(article['rss_id']))
|
||||||
new = article['content']
|
new = article['content']
|
||||||
if old['title'] != new['title']:
|
if old['title'] != new['title']:
|
||||||
print('Article changed. World is fucked.')
|
# print('Article changed. World is fucked.')
|
||||||
diff = process_diff(old, new, article['rss_id'])
|
diff = process_diff(old, new, article['rss_id'])
|
||||||
write_article(article, rc)
|
write_article(article, rc)
|
||||||
return(True)
|
return(True)
|
||||||
|
@ -105,5 +105,4 @@ for feed in config['feeds']:
|
||||||
article_count += 1
|
article_count += 1
|
||||||
process_item(article, rc)
|
process_item(article, rc)
|
||||||
|
|
||||||
print("Processed articles:")
|
print("Processed articles: " + article_count)
|
||||||
print(article_count)
|
|
Loading…
Reference in a new issue