-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclock.py
39 lines (27 loc) · 906 Bytes
/
clock.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from apscheduler.schedulers.blocking import BlockingScheduler
from spiders import rfs, usgs, taiwan, noaa
from common import transmit
from pytz import utc
from datetime import datetime
sched = BlockingScheduler(timezone=utc)
@sched.scheduled_job('interval', minutes=3)
def rfs_timed_job():
print("Running RFS Spider at %s" % datetime.now())
alerts = rfs()
transmit(alerts)
@sched.scheduled_job('interval', minutes=3)
def usgs_timed_job():
print("Running USGS Spider at %s" % datetime.now())
alerts = usgs()
transmit(alerts)
@sched.scheduled_job('interval', minutes=10)
def taiwan_timed_job():
print("Running Taiwan Spider at %s" % datetime.now())
alerts = taiwan()
transmit(alerts)
@sched.scheduled_job('interval', minutes=5)
def noaa_timed_job():
print("Running NOAA Spider at %s" % datetime.now())
alerts = noaa()
transmit(alerts)
sched.start()