def get_ttachment(post, data):
attachment = {
'name': data['title'],
'link': '{0}{1}/'.format(settings.DOMAIN, post.slug)
}
sentiment = post.sentiment or "N/A"
summary = post.summary or ""
attachment['description'] = strip_tags(summary) + " " + sentiment
if post.image:
attachment['picture'] = '{0}{1}'.format(settings.DOMAIN, post.image)
return attachment
评论列表
文章目录