Inspiration

There are a heap of petrol price finding apps - but they require you to download an app and then register. I wanted to create a simple way of finding cheap petrol prices.

What it does

Petrol Bot provides you with an easy way to find the cheapest petrol price in your suburb.

Simply ask Petrol Bot for the cheapest type of petrol in your suburb: "Where can I find the cheapest unleaded in Sydney?"

Petrol Bot will then list nearby petrol stations with the cheapest price listed first. You can show the address of any petrol stations in the list, and then click on the address to go to Map/Google Maps and get directions to that petrol station.

You can ask for help at any time to see some example questions you can ask Petrol Bot.

How I built it

First, I created a Java SDK that was missing from Amazon's suite of SDK's. See the Lex Lambda SDK. This SDK enables Lex bots to be implemented quickly in Java and deployed to Amazon Lambda.

Petrol Bot uses 6 Lex Intents and 3 custom slot types.

The source of the petrol price data is from publicly availably APIs provided by the New South Wales and Western Australia governments. Petrol Bot essentially is a bridge between Lex and these APIs.

Petrol Bot was written in Java 8 using IntelliJ and Maven. It is deployed to Amazon Lambda and images are hosted in Amazon S3.

Challenges I ran into

Determining the optimal size of the images for the cards (Facebook generic template) took a lot of trial and error. Also, Facebook seemed to cache the images, so resizing them meant I had to change the filename each time I wanted to test. There was also a delay in seeing the new images in Messenger.

The Lex Console took a bit of getting used to. I have previously developed Alexa Skills and the concept of different versions of an Intent, and sharing Intents between bots was new to me.

Australian suburbs can exist in more than one state, which added complexity to voice interface the Java code for handling the intent.

Accomplishments that I'm proud of

The use of cards (Facebook generic template) for lists of information. Adding the petrol station brand images into the list of prices added a professional touch to the bot, but I had to remove them due to the AWS Chatbot Challenge Rules. Was also happy that when friends tested the bot, the feedback was that it was very easy to use and very helpful.

What I learned

How to use the AWS Console to build a Lex bot, configure channels and publish to Facebook. Also, how to setup a Facebook App.

Also learned that a large number of petrol brands use the colours blue and red in their logos.

What's next for Petrol Bot

Hopefully, Lex will be enhanced so that the users GPS location can be sent from the phone. This will remove the need to ask the user for their suburb.

Allowing to user to set their preferred petrol type and suburb, so they doesn't need to specify this each time.

Also, I'm investigating alternative sources of petrol prices so the bot can be used throughout the country.

Built With

Share this project:

Updates