From 2e13a266c6cf44f4ba4e0ab3bea174e30a99efe9 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Sun, 1 Jun 2014 14:39:26 +0100 Subject: [PATCH] Fixed og:type --- spa/models/activity.py | 19 +++++++++++++------ spa/social/views.py | 2 +- templates/inc/facebook/mix.html | 6 +----- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/spa/models/activity.py b/spa/models/activity.py index 7f741be..1692bfa 100755 --- a/spa/models/activity.py +++ b/spa/models/activity.py @@ -1,8 +1,10 @@ import abc -from allauth.socialaccount.models import SocialAccount +from allauth.socialaccount.models import SocialAccount, SocialToken +from allauth.socialaccount.providers.facebook.provider import FacebookAccount from django.db import models from model_utils.managers import InheritanceManager +from open_facebook import OpenFacebook from core.utils.url import wrap_full from spa.models.notification import Notification @@ -28,11 +30,16 @@ class Activity(_BaseModel): return "%s" % self.get_object_name() def post_social(self): - social_account = SocialAccount.objects.filter(user=self.user)[0] - if social_account: - provider = social_account.get_provider_account() - print "Here" - + return + """ + social_account = SocialToken.objects.filter(account__user=self.user.user, account__provider='facebook')[0] + facebook = OpenFacebook(social_account.token) + notification_html = { + 'mix': self.get_object_url() + } + result = facebook.set('me/deepsouthsounds:play?', message=notification_html) + print "Here" + """ def create_notification(self): try: notification = Notification() diff --git a/spa/social/views.py b/spa/social/views.py index 1999352..3fb169f 100755 --- a/spa/social/views.py +++ b/spa/social/views.py @@ -38,7 +38,7 @@ def mix(request, args): except Mix.DoesNotExist: raise Http404 - image = mix.get_image_url('1500x1500') + image = mix.get_image_url('200x200') audio_url = mix.get_stream_path() mix_url = mix.get_absolute_url() default = _getPayload(request) diff --git a/templates/inc/facebook/mix.html b/templates/inc/facebook/mix.html index ed076d1..ce7fd42 100755 --- a/templates/inc/facebook/mix.html +++ b/templates/inc/facebook/mix.html @@ -7,11 +7,7 @@ - - {% comment %} - - - {% endcomment %} +