1
0
Fork 0

Restructure directory layout

To make this better than the unorganized mess it used to be.
This commit is contained in:
Luca Beltrame 2021-01-03 15:26:29 +01:00
parent 58a36ed632
commit c4f7279f2e
Signed by: einar
GPG key ID: 4707F46E9EC72DEC
25 changed files with 0 additions and 727 deletions

27
travel/hyperdia_suggest.py Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/python3
import argparse
import requests
HYPERDIA_SUGGEST_URL = "http://www.hyperdia.com/en/cgi/suggest/en/nsnl.cgi"
def main():
parser = argparse.ArgumentParser()
parser.add_argument("name", help="Name or partial name to search for")
options = parser.parse_args()
req = requests.get(HYPERDIA_SUGGEST_URL, params=options.name.upper()
+ "_null")
if req.status_code == 200:
print("Possible matches:")
for item in req.text.split(","):
print(item)
if __name__ == "__main__":
main()