문제

I need to update my Facebook Fan Page in a django app so I have this code:

import facebook
from django.conf import settings

def login_facebook():
    fb = facebook.Facebook(settings.FACEBOOK_API_KEY, settings.FACEBOOK_SECRET_KEY)
    fb.session_key = settings.FACEBOOK_SESSION
    fb.secret = settings.FACEBOOK_SECRET_KEY
    fb.uid = settings.FACEBOOK_UID
    return fb

def update_status(fb, message):
    return fb.stream.publish(message=status_message)

And I use this to run it with ipython:

import src.tests.scripts.facebook_publish_fanpage as f
fb = f.login_facebook()
f.update_status(fb, 'This is a test')

But I get this exception:

AttributeError: 'Facebook' object has no attribute 'stream'

I already gave permissions to the app following this 2 steps:

Publish post on Facebook page(1) and Authorizing a Facebook Fan Page for Status Updates(2)

But no matter what I try (being doing it a few hours now...) I can't publish to the page...

I'm lost now, any help?

(1) tech.karolzielinski.com/publish-post-of-facebook-page-wall-as-a-page-not-a-user-python-facebook-rest-api

(2) stackoverflow.com/questions/2097665/authorizing-a-facebook-fan-page-for-status-updates

PD: Sorry don't have permission to add the links yet, I'm mostly a reader in SO

도움이 되었습니까?

해결책

상파기판에서 파쇄 된 스토리지를 사용할 수있는 것처럼 보이지만 SP 온라인에서는 사용할 수 없습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top