diff options
| author | jantuomi <jans.tuomi@gmail.com> | 2016-07-18 16:01:58 +0300 |
|---|---|---|
| committer | jantuomi <jans.tuomi@gmail.com> | 2016-07-18 16:02:35 +0300 |
| commit | e5dede846917747e688a4b6581da019712ca9b1d (patch) | |
| tree | 3fa26f8f19077a4c2837693036be01c035ac0acf /radiodiodibot.py | |
| parent | 2756b0b849d759001a34f89f29164feca9ad4568 (diff) | |
Add option to change API call interval
Diffstat (limited to 'radiodiodibot.py')
| -rwxr-xr-x | radiodiodibot.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/radiodiodibot.py b/radiodiodibot.py index 190cac0..022e685 100755 --- a/radiodiodibot.py +++ b/radiodiodibot.py @@ -20,6 +20,7 @@ parser.add_argument("telegram_bot_token", help="Telegram Bot API token") parser.add_argument("-U", "--shoutbox-api-url", help="Shoutbox API URL") parser.add_argument("-C", "--telegram-chat-id", help="Telegram Chat ID") parser.add_argument("-v", "--verbose", help="Verbose output", action="store_true") +parser.add_argument("-i", "--interval", help="Delay between API update calls in seconds", type=int, default=10) args = parser.parse_args() if args.verbose: @@ -54,8 +55,11 @@ def main(): if telegram_chat_id is not None: manager.telegram_chat_id = telegram_chat_id + manager.api_call_interval = args.interval + logging.info("Using Shoutbox API URL: {}".format(manager.shoutbox_api_url)) logging.info("Using Telegram Chat ID: {}".format(manager.telegram_chat_id)) + logging.info("Using API call interval of {} seconds.".format(manager.api_call_interval)) manager.start() |
