Creating a Like-Gate (reveal tab) for a Facebook app, using Django/Python

后端 未结 3 1823
独厮守ぢ
独厮守ぢ 2021-01-14 15:00

I\'m building a Facebook app using Python/Django. I\'ve installed FanDjango and that works great. Just one more thing I need.

I\'d like to build a \"like-gate\" fo

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 15:33

    Thanks. I got this to work by reading through the documentation in the facepy module I have installed. Here's how you access a user's "like" info for a particular page:

    from facepy import SignedRequest
    if 'signed_request' in request.REQUEST:
        signed_request = SignedRequest.parse(request.REQUEST.get('signed_request'), settings.FACEBOOK_APPLICATION_SECRET_KEY)
    if signed_request.page.is_liked:
        test = "yes!"
    else:
        test = "no!"  
    

提交回复
热议问题