ineshbose / boyd_bot_messenger

Boyd Bot (Flask Version)
https://inesh.xyz/boyd_bot_messenger
MIT License
6 stars 3 forks source link

Provide Locations for Classes #1

Open ineshbose opened 4 years ago

ineshbose commented 4 years ago

The bot should be able to provide a map, directions or link when a user asks for a specific location on campus. For example,

"Where is my next Psychology lecture?" "Where is the Boyd Orr building?"

The locations can be found using event["location"] in timetable.py (that is if "location" in event else return "No Location Found"). A raw link would be a little shabby, so an embedded map in the chat-bubble is preferred but this is not supported by all platforms.

Google Maps is the preferred service for locations. Some universities also use a custom map (by Google Maps) for their campus (eg https://www.gla.ac.uk/explore/maps/).

ineshbose commented 4 years ago

Possible Solution: JSON Map data could be populated as a JSON with keys buildingName, description and link. When the intent is triggered by the parser, fuzz can be used to iterate and match the name and then return the info.

Problem: Populating the data

  1. Manually filling out campus data would be disaster.
  2. Google Maps JSON can be fetched through deep inspection of custom maps, but it doesn't involve suitable data (eg link, description).
ineshbose commented 4 years ago

Big Obstacle: Link for Location

Even if we have the name for a place, it's difficult to provide an accurate link for the place. For example, "Main Building" can be anything. Appending University name could get a little weird since the buildingName can be anything. So, a good idea would be to use coordinates.

But the option would be https://maps.google.com/?q=main+building+university+of+glasgow However, if we're just sending them a search link, what's the use? It may show the desired location, or just multiple results. Not desirable.

Another would be https://www.google.com/maps/search/?api=1&query=%2C But this needs coordinates of the place. Now this can be fetched using OpenStreetMaps. A good link to get JSON is https://nominatim.openstreetmap.org/