Skip to content
Permalink
Browse files
Add files via upload
  • Loading branch information
Farooqm10 committed Mar 20, 2020
0 parents commit c97fefb5b46b905339eeff6ee3c5d01ec0ed0c42
Showing 1 changed file with 204 additions and 0 deletions.
@@ -0,0 +1,204 @@
import time
import random
import requests
import json
###############################################################################################################################
############### i learned import from codio labs ###################################################################
##### learned json and requests from {{{{https://www.pythonforbeginners.com/requests/using-requests-in-python}}}} #########
###############################################################################################################################


name=input("Hello, What's your name? ")
print("Heyy " + name)

dest = input("I am Coventry University Location bot! \n Do you want to go somewhere? ")
dest = dest.lower()
time.sleep(1)

if dest == "yess" or dest == "yeah" or dest == "sure" or dest == "it is" or dest == "yea" or dest == "yes" or dest == "yo" in dest:
print("Ohkay! I can help you ...")

##################################################################################################
###################### learnd input() from codio labs #######################
##################################################################################################



Location = input("Here I can show you Buildings List! Just Choose where you want to go, I'll guide you the right path. OKAY? :")
location = Location.lower()
time.sleep(1)
if Location == "okay" or Location == "ok" or Location == "fine" or Location == "show" or Location == "thanks" or Location == "sure" or Location == "cool" or Location == "yeah" or Location == "yea" or Location == "yo" in Location:

List = input("1:Alan Berry \n 2:Alma \n 3:Bugatti \n 4:Charles Ward \n 5:Enineering & Computer Building \n 6:Ellen Terry \n 7:George Eliot \n 8:Graham Sutherland \n 9:Library(Frederick Lanchester) \n 10:Jaguar \n 11:The Hub \n 12:Maurice Foss \n 13:James Starley \n 14:Multi-Storey Car Park \n 15:Priory Building \n 16:Richard Crossman \n 17:Alison Gingell Building \n 18:Sir John Laing \n 19:Student Centre \n 20:Whitefriars \n 21:William Morris \n 22:Sports Centre")
print(List)
if List == "1":
print("1 Priory St, Coventry CV1 5FB / From the steps of the Cathedral you’ll be able to see the Alan Berry building. ")
elif List == "2":
print("Alma St, Coventry CV1 5QA / Down to Cox Street behind New tasty Chicken&Pizza. ")
elif List == "3":
print("Grove St, Coventry CV1 5PH / Cross to the Ellen Terry side of the street and turn left. Carry on across Gosford Street, Bugatti is located further down Cox Street. ")
elif List == "4":
print("Cope St, Coventry CV1 5FD / Walk down to the left of the Alan Berry building Charles Ward building is ahead of you.")
elif List == "5":
print("3 Gulson Rd, Coventry CV1 2JH / Right in front of Student centre Engineering & Computing campus is located along Gulson Road. ")
elif List == "6":
print("34-35 Jordan Well, Coventry CV1 5RW / Right infront of The Hub, Ellen Terry building is located. ")
elif List == "7":
print("Priory St, Coventry CV1 5FB / The Building opposite to The Hub is George Eliot Building located beside University Square. ")
elif List == "8":
print("Cox St, Coventry CV1 5PH / Graham Sutherland is located on Cox Street beside Maurice Foss Building. ")
elif List == "9":
print("Gosford St, Coventry CV1 5DD / Library is right infront of Engineering & Computing Building beside William Morris Building")
elif List == "10":
print("113A Gosford St, Coventry CV1 5DL / Jaguar is located at opposite side of William Morris Building across Gosford Road. ")
elif List == "11":
print("34-35 Priory St, Coventry CV1 5QP / Located right infront of Ellen Terry Building on priory road. ")
elif List == "12":
print("Cox St, Coventry CV1 5PH / Located beside Graham Sutherland Building down on Cox Street. ")
#################################################################################################################
####################### learned if/elif and else statesment from codio labs week 3 ###########################
##################################################################################################################
elif List == "13":
print("Priory St, Coventry CV1 5FB / Located right infront of Maurice Foss Building on Cox Street. ")
elif List == "14":
print("Gosford St, Coventry CV1 5DL / Located right behind of Lanchester Library. ")
elif List == "15":
print("Priory Building, Coventry CV1 5FJ / Located on Fairfax road right beside Coventry Sports & Leisure Centre. ")
elif List == "16":
print(" Jordan Well, Road, Coventry CV1 5RW / Infront of The Hub reight beside Ellen Terry Building Richard Crossman Building is located. ")
elif List == "17":
print("Coventry CV1 5FB / Located right beside Coventry University Sport and Recreation Centre. ")
#####################################################################################################3
############################ used functions in functions after 2 4006cem presentation #############3
#####################################################################################################3
elif List == "18":
print("Much Park St, Coventry CV1 2LT / Located at the backside of Coventry University Sport and Recreation Centre beside Alison Gingell Building. ")
elif List == "19":
print("1 Gulson Rd, Coventry CV1 2JH / Located on the right side of Engineering & Computing Building along Gulson Road. ")
elif List == "20":
print("62 Whitefriars St, Coventry CV1 2DS / Whitefriars is located beside Coventry University Sport and Recreation Centre, infront of Sir John Laing Building. ")
elif List == "21":
print("Gosford St, Coventry CV1 5DL / Walk down Gosford Street and under the brightly lit ring road flyover until you see William Morris building. ")
elif List == "22":
print("Whitefriars St, Coventry CV1 / Located beside Alison Gingell Building, infront of Sir John Laing Building. ")
else:
print("Sorry i dont know about this entry")

else:
print("I can only help you in location stuff")

else:
print("Sorry my bad i'm still getting trained")

###################################################################################################################3
###################################################################################################################3
#################################### used api in "further information" ########################################3
###################################################################################################################3
###################################################################################################################3




print("================================================================================================================================")
further = input("Do you need any further information about buildings?")
further = further.lower()
if further == "yess" or further == "yeah" or further == "sure" or further == "it is" or further == "yea" or further == "yes" in further:
#https://eu1.locationiq.com/v1/search.php?key=YOUR_PRIVATE_TOKEN&q=SEARCH_STRING&format=json
# #api_key=2e98636f921b52



#####################################################################################################################################
### searched on google for maps api and found on [[[https://my.locationiq.com/dashboard/login?ref=locationiq#account]]] #########
#####################################################################################################################################




base_url = "https://eu1.locationiq.com/v1/search.php?key=2e98636f921b52&format=json&q="
print("Enter Location name followed by City Name! ")
search_query = input(">>")
api_call = base_url + str(search_query)
req = requests.get(api_call).json()

print(api_call)
#print(req)

place_name = req[0]["display_name"]
place_type = req[0]["type"]

##############################################################################################################################
#################### read documentation from [[[["https://locationiq.com/docs#forward-geocoding"]]]] ####################
##############################################################################################################################

print(place_name)
print(place_type)


#####################################################################################################
################# Took help Harshkumar Panchal Id = 9979046 about api #########################
#####################################################################################################


else:
print("Okay thanks Bye")

input("Press enter to exit")

##########################################################################################
##########################################################################################
##################### Just did CHATBOT PROJECT BECAUSE I WAS ######################
##################### ARRIVED LATE IN MY SESSSION JUST BECAUSE ######################
##################### OF VISA DELAY........ ######################
##########################################################################################



















































0 comments on commit c97fefb

Please sign in to comment.