import ijson
from app.db_models import Tweet

# TODO

print('ues')
# input_path = '../data/1-1-2018.geojson'
input_path = '../data/test.json'
with open(input_path, 'r') as f:
    # parser = ijson.parse(f)


    objects = ijson.items(f, 'posts')
    # objects = ijson.items(f, 'features')

    # print(list(objects)[0])
    for tweets in objects:
        for tweet in tweets:
            print(tweet)
            print(tweet['timestamp'])

    # for i in objects[0]:
    #     _name =
    #     print(i['posts'][0])
    #
    # t = Tweet(user_name=_name,
    #           latitude=_la,
    #           longitude=_lo,
    #           tweet=_tweet,
    #           sentiment=_sentiment,
    #           )
a0d1398ea4d0f578b41e2436b0478f5674eebefc
<mask token>

<mask token>
print('ues')
<mask token>
with open(input_path, 'r') as f:
    objects = ijson.items(f, 'posts')
    for tweets in objects:
        for tweet in tweets:
            print(tweet)
            print(tweet['timestamp'])

<mask token>
print('ues')
input_path = '../data/test.json'
with open(input_path, 'r') as f:
    objects = ijson.items(f, 'posts')
    for tweets in objects:
        for tweet in tweets:
            print(tweet)
            print(tweet['timestamp'])

import ijson
from app.db_models import Tweet
print('ues')
input_path = '../data/test.json'
with open(input_path, 'r') as f:
    objects = ijson.items(f, 'posts')
    for tweets in objects:
        for tweet in tweets:
            print(tweet)
            print(tweet['timestamp'])

import ijson
from app.db_models import Tweet

# TODO

print('ues')
# input_path = '../data/1-1-2018.geojson'
input_path = '../data/test.json'
with open(input_path, 'r') as f:
    # parser = ijson.parse(f)


    objects = ijson.items(f, 'posts')
    # objects = ijson.items(f, 'features')

    # print(list(objects)[0])
    for tweets in objects:
        for tweet in tweets:
            print(tweet)
            print(tweet['timestamp'])

    # for i in objects[0]:
    #     _name =
    #     print(i['posts'][0])
    #
    # t = Tweet(user_name=_name,
    #           latitude=_la,
    #           longitude=_lo,
    #           tweet=_tweet,
    #           sentiment=_sentiment,
    #           )