2020-07-05 18:20:42 +02:00
|
|
|
import argparse
|
2020-01-07 02:53:59 +01:00
|
|
|
|
2020-07-05 18:20:42 +02:00
|
|
|
from twomartens.allrisscraper import internal
|
|
|
|
from twomartens.allrisscraper import public
|
2020-01-07 02:53:59 +01:00
|
|
|
|
|
|
|
|
2020-07-05 18:20:42 +02:00
|
|
|
def main():
|
|
|
|
parser = argparse.ArgumentParser(description="Scrape the ALLRis website")
|
2020-07-05 18:37:29 +02:00
|
|
|
subparsers = parser.add_subparsers(help="sub-command help", required=True)
|
|
|
|
oparl_parser = subparsers.add_parser("oparl", help="scrapes the public website")
|
|
|
|
oparl_parser.add_argument("--include-organizations", action="store_true", dest="include_organizations")
|
2020-07-05 21:38:17 +02:00
|
|
|
oparl_parser.add_argument("--include-meetings", action="store_true", dest="include_meetings")
|
2020-07-05 18:37:29 +02:00
|
|
|
oparl_parser.set_defaults(function=public.main)
|
|
|
|
internal_parser = subparsers.add_parser("internal", help="scrapes the internal website")
|
|
|
|
internal_parser.set_defaults(function=internal.main)
|
2020-01-15 09:13:39 +01:00
|
|
|
|
2020-07-05 18:37:29 +02:00
|
|
|
args = parser.parse_args()
|
2020-07-05 21:38:17 +02:00
|
|
|
args.function(args)
|
2020-07-05 18:37:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|