mirror of
https://github.com/ai-robots-txt/ai.robots.txt.git
synced 2025-04-19 00:26:01 +00:00
make conversions and updates separately triggerable
This commit is contained in:
parent
6ab8fb2d37
commit
3ab22bc498
2 changed files with 38 additions and 5 deletions
|
@ -153,5 +153,31 @@ def conversions():
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ingest_darkvisitors()
|
||||
conversions()
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="ai-robots",
|
||||
description="Collects and updates information about web scrapers of AI companies.",
|
||||
epilog="One of the flags must be set.\n",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--update",
|
||||
action="store_true",
|
||||
help="Update the robots.json file with data from darkvisitors.com/agents",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--convert",
|
||||
action="store_true",
|
||||
help="Create the robots.txt and markdown table from robots.json",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if not (args.update or args.convert):
|
||||
print("ERROR: please provide one of the possible flags.")
|
||||
parser.print_help()
|
||||
|
||||
if args.update:
|
||||
ingest_darkvisitors()
|
||||
if args.convert:
|
||||
conversions()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue