You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
914 B
44 lines
914 B
#!/usr/bin/env python3
|
|
|
|
"""look up TGs on brandmeister.network
|
|
"""
|
|
|
|
#import re # regex
|
|
import sys
|
|
#import argparse
|
|
import webbrowser
|
|
|
|
|
|
def main():
|
|
"""main function
|
|
|
|
Runs if script is run by itself."""
|
|
if len(sys.argv) <= 1:
|
|
# Check if arguments were given, if not, let the user
|
|
# input some here
|
|
arguments = []
|
|
|
|
userinput = input("Enter TG: ")
|
|
words = userinput.split()
|
|
for word in words:
|
|
arguments.append(word)
|
|
|
|
tg = arguments[0]
|
|
else:
|
|
# If arguments were given, take them and move on
|
|
tg = sys.argv[1]
|
|
|
|
if not isinstance(tg, int):
|
|
try:
|
|
tg = int(tg)
|
|
except:
|
|
print("Invalid value.")
|
|
exit(1)
|
|
|
|
url = "https://brandmeister.network/?page=lh&DestinationID={}".format(tg)
|
|
webbrowser.open(url, new=0, autoraise=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|