mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-29 12:02:42 +00:00
Initial Commit
This commit is contained in:
16
ProjectBefore/PythonCode/Midi/DbUpdate.py
Normal file
16
ProjectBefore/PythonCode/Midi/DbUpdate.py
Normal 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()
|
Reference in New Issue
Block a user