# Path: sources/models.py
# class FacebookPost(models.Model):
#     access_token = models.CharField(max_length=100)
#     data = JSONField()
#     created_time = models.DateTimeField()


from datetime import datetime
from urllib2 import urlopen, HTTPError
from django.db.models import Max
from sources.models import FacebookPost
import json



def time(s):
    return datetime.strptime(s, '%Y-%m-%dT%H:%M:%S+0000')

def post_text(item):
    return item.get('message', u'') + item.get('description', u'')

def list_posts(access_token):

# Path: sources/models.py
# class FacebookPost(models.Model):
#     access_token = models.CharField(max_length=100)
#     data = JSONField()
#     created_time = models.DateTimeField()


# Path: sources/facebook.py
from datetime import datetime
from urllib2 import urlopen, HTTPError
from django.db.models import Max
from sources.models import FacebookPost
import json




def time(s):
    return datetime.strptime(s, '%Y-%m-%dT%H:%M:%S+0000')

def post_text(item):
    return item.get('message', u'') + item.get('description', u'')

def list_posts(access_token):

    latest_created_time = FacebookPost.objects\