Skip to content

Commit bb600e5

Browse files
committed
Trending articles message
1 parent d3cfd71 commit bb600e5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

main.py

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# Analyze keywords
2121
analyzer = Analyzer(entries)
2222
keywords = analyzer.get_keywords_count()
23+
pprint(keywords)
2324

2425
# Get data from analyzer.
2526
data = analyzer.get_morst_relevant_data(keywords)
@@ -30,3 +31,10 @@
3031

3132
slack_message = "What's happening today: {}\n\n{}".format(article_result.orginal.title, article_result.url)
3233
request('GET', 'https://slack.com/api/chat.postMessage?token=xoxp-87076484640-87088670897-121376898595-f020c7663ad965c5ed1a3722bcec15a8&channel=python-hacks&text={}&pretty=1'.format(slack_message))
34+
35+
titles = "\n".join([article.orginal.title for article in data['trending_articles']])
36+
pprint(titles)
37+
slack_message = "Other trending articles: \n\n{}".format(titles)
38+
request('GET',
39+
'https://slack.com/api/chat.postMessage?token=xoxp-87076484640-87088670897-121376898595-f020c7663ad965c5ed1a3722bcec15a8&channel=python-hacks&text={}&pretty=1'.format(
40+
slack_message))

0 commit comments

Comments
 (0)