mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-29 12:02:42 +00:00
Initial Commit
This commit is contained in:
31
ProjectBefore/PythonCode/Midi/RunTwitterRoutine.py
Normal file
31
ProjectBefore/PythonCode/Midi/RunTwitterRoutine.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
import sys
|
||||
import schedule
|
||||
import MidiGenerator as m
|
||||
import time
|
||||
from os import listdir
|
||||
from os.path import isfile, join
|
||||
import twitter
|
||||
import json
|
||||
import requests
|
||||
from multiprocessing import Process
|
||||
|
||||
mongodbPath = 'c:/MongoDb/bin/mongod'
|
||||
jsonPath = 'tweets.json'
|
||||
|
||||
|
||||
def runLoop():
|
||||
os.system('python TwitterGetExample.py')
|
||||
os.system('python Interpreter.py ' + jsonPath)
|
||||
time.sleep(30)
|
||||
os.system('python DbUpdate.py')
|
||||
|
||||
|
||||
schedule.every(1).minutes.do(runLoop)
|
||||
#os.system(mongodbPath) this doesn't finish, so other programs won't run
|
||||
runLoop()
|
||||
|
||||
|
||||
while 1:
|
||||
schedule.run_pending()
|
||||
time.sleep(1)
|
Reference in New Issue
Block a user