]>
git.scottworley.com Git - paperdoorknob/blob - paperdoorknob.py
cd93e4ef69c24b84679432ac0a5d6435aff6e813
1 # paperdoorknob: Print glowfic
3 # This program is free software: you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License as published by the
5 # Free Software Foundation, version 3.
8 from argparse
import ArgumentParser
12 def command_line_parser() -> ArgumentParser
:
13 parser
= ArgumentParser(prog
='paperdoorknob', description
='Print glowfic')
16 help='How long to wait for HTTP requests, in seconds',
18 parser
.add_argument('url', help='URL to retrieve')
22 def fetch(url
: str, timeout
: int) -> None:
23 r
= requests
.get(url
, timeout
=timeout
)
28 args
= command_line_parser().parse_args()
29 fetch(args
.url
, args
.timeout
)
32 if __name__
== '__main__':