diff options
author | bloodstalker <thabogre@gmail.com> | 2018-05-24 14:43:05 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-05-24 14:43:05 +0000 |
commit | 69973534c75b2eb18045df90bb83df13404b2f61 (patch) | |
tree | c07c61b127ecc94c3826666d14d0b35f3a4386cf | |
parent | update (diff) | |
download | kaminokumo-69973534c75b2eb18045df90bb83df13404b2f61.tar.gz kaminokumo-69973534c75b2eb18045df90bb83df13404b2f61.zip |
update
-rwxr-xr-x | kaminokumo | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -11,6 +11,7 @@ import requests import urllib3 from time import sleep from bs4 import BeautifulSoup +import subprocess def SigHandler_SIGINT(signum, frame): print() @@ -20,6 +21,7 @@ class Argparser(object): def __init__(self): parser = argparse.ArgumentParser() parser.add_argument("--url", type=str, nargs="+", help="url to scrape") + parser.add_argument("--name", type=str, nargs="+", help="url to scrape") parser.add_argument("--dbg", action="store_true", help="debug", default=False) parser.add_argument("--demon", action="store_true", help="run as daemon", default=False) parser.add_argument("--slumber", type=int, help="how long the demon sleeps", default=60) @@ -39,12 +41,21 @@ def mrg(url): return True return False +def vocalize(sound): + subprocess.call([os.path.expanduser("~")+"/scripts/voice.sh", sound]) ############################################################################### def premain(argparser): signal.signal(signal.SIGINT, SigHandler_SIGINT) url = json.load(open("/home/bloodstalker/extra/kaminokumo/data.json")) - if mrg(url["1"]): print("mg") - if mrg(url["2"]): print ("obk") + if mrg(url["1"]): + print("mg") + vocalize(os.path.expanduser("~") + "/scripts/mila/mgup.ogg") + if mrg(url["2"]): + print ("obk") + vocalize(os.path.expanduser("~") + "/scripts/mila/obk.ogg") + if mrg(url["3"]): + print ("mlv") + vocalize(os.path.expanduser("~") + "/scripts/mila/obk.ogg") def main(): argparser = Argparser() |