Mercurial > public > sg101
diff gpp/podcast/models.py @ 487:77d878acea5e
For #233; add social media sharing buttons to podcast pages.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 19 Oct 2011 00:05:54 +0000 |
parents | d424b8bae71d |
children | 368d731af479 |
line wrap: on
line diff
--- a/gpp/podcast/models.py Tue Oct 18 23:23:42 2011 +0000 +++ b/gpp/podcast/models.py Wed Oct 19 00:05:54 2011 +0000 @@ -79,3 +79,20 @@ def search_summary(self): return u"\n".join((self.subtitle, self.summary, self.keywords)) + + def ogp_tags(self): + """ + Returns a dict of Open Graph Protocol meta tags. + + """ + title = "%s: %s; %s" % (self.channel.title, self.title, self.subtitle) + return { + 'og:title': title, + 'og:type': 'article', + 'og:url': self.get_absolute_url(), + 'og:description': self.subtitle, + 'og:audio': self.enclosure_url, + 'og:audio:title': title, + 'og:audio:artist': 'Various', + 'og:audio:type': self.enclosure_type, + }