Initial Commit

This commit is contained in:
2018-05-19 02:20:19 +02:00
commit 8621248968
6554 changed files with 1121559 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import pymongo
from pymongo import MongoClient
import json
client = MongoClient('localhost', 27017)
db = client.tweets
file_obj = open('tweets.json', 'r')
print(file_obj)
raw_data = file_obj.read()
temp = json.loads(raw_data)
post = []
posts = db.posts
for tweet in temp['tweets']:
#post.append(tweet)
db.tweets.insert(tweet)
open("tweets.json", 'w').close()