Inspiration

I built Peek during a previous hackathon but I believed that a ChatBot would make it more accessible to users.

What it does

  • When a user logs on to the app, they are prompted for their destination.
  • A prediction of how crowded the location is expected to be at the time the prompt was entered is then displayed.
  • The prediction is computed relative to the expected minimum and maximum number of people (This information is obtained using the populartimes API)
  • A one-time notification is sent 24 hours after the user's last interaction with the bot (If the user subscribes to one-time notifications). The notification essentially reminds the user to use Peek to check out their destination (this is geared towards helping the user build a habit of using peek)

How I built it

  • The git repository is hosted on Heroku and connected to a Facebook app which is also linked to Peek's Facebook page.
  • Users can access the bot through the Peek Facebook page in messenger.
  • Messages are sent/received via the Messenger webhook API defined inside the express backend.

Challenges I ran into

  • Due to the calls being made to external APIs certain variables were not being updated synchronously.
  • I tried Promises and Async/Await but the responses were still not updating on time.
  • Eventually, I used setTimeouts to delay the responding functions until the variables(e.g prediction results, google places search results, etc.) were updated.
  • I also had to study various new messenger features such as buttons, postbacks, one time notifications, etc.

Accomplishments that I'm proud of

  • Built my first messenger bot and it works.

What I learned

  • Using environment variables
  • Javscript async functions
  • Javascript promises
  • Messenger bot development

What's next for Peek Chatbot

  • Increase location suggestion accuracy for the Bot.
  • Build a mobile platform for Peek

Built With

Share this project:

Updates