def get_arxiv_mail(title_words, abstract_words,
author_words, feed_url, my_mail):
feed = feedparser.parse(feed_url)
filtered_entries = [entry for entry in feed.entries if filter(entry)]
msg = ["<h1>arXiv results for {}</h1>".format(date_str)]
for entry in filtered_entries:
msg.append('<h2>{}</h2>'.format(entry.title))
msg.append('<h3>{}</h3>'.format(strip_html(entry.author)))
msg.append('<p>{}</p>'.format(strip_html(entry.description)))
num = 'arXiv:' + entry['id'].split('/')[-1]
link = '<a href="{}">{}</a>'.format(entry['id'], num)
pdf_link = '[<a href="{}">pdf</a>]'.format(entry.id.replace('abs', 'pdf'))
msg.append(link + " " + pdf_link)
keywords = ', '.join(title_words + abstract_words)
authors = ', '.join(author_words)
footer = ("<p><em>Selected keywords: {}. Selected authors: {}. " +
"From feed: {}</em></p>")
msg.append(footer.format(keywords, authors, feed_url))
msg = "".join(msg)
return msg
评论列表
文章目录