Skip to content

Instantly share code, notes, and snippets.

@jakul
Created October 6, 2015 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakul/e9122de2380837926e8f to your computer and use it in GitHub Desktop.
Save jakul/e9122de2380837926e8f to your computer and use it in GitHub Desktop.
from facebook.models import *
def get_posts(posts):
for post in posts:
account = post.page.accounts.filter(enabled=True).first()
if account is None:
continue
exists = 'multi_share_optimized' in FacebookPost.objects.fetch_page_post(post.page_post_id, account)
print post.page_post_id, exists
if exists:
break
get_posts(FacebookPost.objects.filter(post_id__isnull=False).order_by('-id')[1000:1500])
get_post(FacebookPost.objecst.filter(multi_share_optimized=True))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment