Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Extract from Skynet to
from pymongo import Connection
import time
from datetime import datetime
import plotly
conn = Connection('localhost', 27017)
db = conn.skynet
collection =
# 24 hour time range
time = int(round((time.time() - 86400) * 1000))
results = collection.find({
"timestamp": {"$gte" : time },
"uuid": "UUID"
x = []
y = []
for i in results:
if 'temperature' in i.keys():
ts= str(int(i['timestamp']))[:-3]
# start time
#print x[0]
# end time
#print x[-1]
py = plotly.plotly("USERNAME", "PASSWORD")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.