share_post: add share-to-Diaspora* support

This uses the sharetodiaspora.github.io HTML5 posting app, necessary due
to Diaspora*'s multi-homed nature.
This commit is contained in:
Giel van Schijndel 2015-01-03 22:24:53 +01:00 committed by Justin Mayer
commit bf5a1ecc6b
2 changed files with 6 additions and 1 deletions

View file

@ -51,6 +51,8 @@ Template Example
<section>
<p id="post-share-links">
Share on:
<a href="{{article.share_post['diaspora']}}" target="_blank" title="Share on Diaspora">Diaspora*</a>
<a href="{{article.share_post['twitter']}}" target="_blank" title="Share on Twitter">Twitter</a>
<a href="{{article.share_post['facebook']}}" target="_blank" title="Share on Facebook">Facebook</a>

View file

@ -39,12 +39,15 @@ def share_post(content):
summary = article_summary(content)
tweet = ('%s%s%s' % (title, quote(' '), url)).encode('utf-8')
diaspora_link = 'https://sharetodiaspora.github.io/?title=%s&url=%s' % (title, url)
facebook_link = 'http://www.facebook.com/sharer/sharer.php?s=100&amp;p%%5Burl%%5D=%s' % url
gplus_link = 'https://plus.google.com/share?url=%s' % url
twitter_link = 'http://twitter.com/home?status=%s' % tweet
mail_link = 'mailto:?subject=%s&amp;body=%s' % (title, url)
share_links = {'twitter': twitter_link,
share_links = {
'diaspora': diaspora_link,
'twitter': twitter_link,
'facebook': facebook_link,
'google-plus': gplus_link,
'email': mail_link