-1

I'm trying to embed the most recent Facebook post for my workplace on the front page of our Django site. I've got FacePy installed, an application key for access, and sometimes the post shows up, but usually it doesn't. I'm doing the embed as a custom tag, so here's the slightly modified for privacy code:

from facepy import GraphAPI

@register.simple_tag
def new_fb_post_embed():
    graph = GraphAPI(<<key>>)
    posts = graph.get("/me/feed")
    fb_post_info = posts['data'][0]['id'].split('_')
    return "<div class='fb-post' data-href='https://www.facebook.com/" + fb_post_info[0] + "/posts/" + fb_post_info[1] + "'></div>"

I'm suspecting it has something to do with using an application key, or with information being cached, but since there is no error being produced I'm really only guessing.

slink
  • 211
  • 3
  • 15

1 Answers1

-1

And painful stupidity set in:

Always make sure you have the Facebook Graph API Javascript SDK loaded in your page if you are using the Javascript SDK to display information.

slink
  • 211
  • 3
  • 15