EbayBot Part 1: Getting search results

The British Heart Foundation eBay store is probably one of the most successful charity stores on eBay. It has thousands of listings of all kinds of interesting and unique items that have been donated to the BHF to raise money for life saving research into all kinds of heart conditions.

EbayBot Part 1: Getting search results

I wanted to build a Chatbot that could search the listings of a specific eBay store and return results based on a user inputted search term. The idea was simple; the bot asks the user what they are looking for, the user enters their search term, e.g. “camera”, and the bot returns all the listings on the BHF eBay store that match.

I broke the flow into three parts: Getting the search results, displaying the search results, and filtering the search results.

This was my first bot using an API to pull data from the web so I had a lot to learn about how to get the search results from eBay. And I didn’t really know how I was going to get the results to display in a chatbot, which listing info was essential and which I could do without, but I knew that with thousands of products on the BHF eBay Store at any one time, the third stage of filtering the listings was going to be essential for making the chatbot useful.

Getting the search results

I started by creating a developer account with ebay to get access to this suite of API’s.

EbayBot Part 1: Getting search results

Ebay has an API called ‘findItemsIneBayStores’ but I couldn’t get it to return results for the BHF store. A quick bit of Goggling showed that this API was known to be unreliable so I moved on to using the ‘findItemsAdvanced’ API.

EbayBot Part 1: Getting search results

This gave me greater control over the returning results which meant that I could pull results only for the correct store and get the elements I wanted to display to the user: Listing name, image, url on eBay. This API also allowed me to limit the number of returning results and display them in order of finished soonest first. Doing this would reduce the amount of filtering the user would have to do to find an item they were interested in.

So, when the flow was the started, EbayBot asks the user what they would like to search for. The users types ‘camera’

EbayBot Part 1: Getting search results

The bot then uses the eBay API to pull back data for active listings in the BHF store that contain the keyword ‘camera’.

EbayBot Part 1: Getting search results

Getting reliable search results returned in JSON format was great. Now I had all the data I needed.

The next steps

The next step will be to figure the best way to display these results to the user in the chat flow. I think it’ll probably be a set of image cards that show the listing title, an image of the product, perhaps the current price, and either a link to the listing on eBay or a button to look at a single listing in more detail. I think this user experience decision comes down to whether users are likely to be able to choose the listing they are looking for with the first set of results, which means sending them out of the flow to eBay would be fine, or if the first set of results doesn’t give them enough info to choose, in which case i wouldn’t want them bouncing back and forth between the bot and the eBay website so I’ll make it so they can go into expanded information for each listing. I might also have a look at whether there is a way to identify if they have the eBay app installed on their phone and if so open that rather than link to the website.

On the rooftop again

If you ever find yourself on a rooftop in danger of falling off having blindly followed when you knew you should be leading, and you tell yourself that next time you’ll make different decisions, know that when that next time came around you at least went up on to the roof having not made the same mistake in the same way.

Handling risk in an Agile way

I’ve been thinking a lot about how an organisation with such a strong tendency towards risk-aversion could become more Agile in how it deals with risks associated with projects and programmes.

For a charity, risks come in all shapes and sizes, from risks associated with spending supporters money to risks of fines from the ICO. Risks to reputation that affect public opinion and supporter’s trust are important, so the objective here isn’t to ignore the risks and be reckless, the objective is to find better ways of reducing risks where possible and handling where necessary.

Risk-averse decision-making

In a risk-averse culture, risks are mitigated in two ways; 1) attempt to make the risk as known as possible by getting as much information up front as possible, and 2) involve as many people as possible to use their knowledge and experience, and to spread the blame if something goes wrong.

Making risks known

The first step to making decision in a risk-averse culture is about getting as much information about the risks up front in an attempt to make decisions about which direction a project should go. It seems to make sense that the more information we have the better decisions we’d make, but research suggests that experienced decision makers don’t make significantly better decisions with significantly more information provided they already have good domain knowledge.

So perhaps the lessons here is that you don’t need all the information in order to make a decision, and that the experts should be the ones making the decisions.

Involving lots of people

In a risk-averse organisation the number of people involved in making a decision is often in double figures. But if everyone knows and everyone agrees, then no one gets the blame if something goes wrong.

But this way of spreading the risk only really fits if the risk is considered as one big risk. If the risks were considered as lots of small risks, then they could be tackled in a different way, with the right people taking responsibility for the right risks rather than everybody taking responsibility for the whole risk.

So maybe the lesson here is that risks can be dealt with better by breaking up into many smaller risks.

Agile controls risk by accepting uncertainty

Managing risk in an Agile way means accepting that all the information isn’t known up front, and that more information can be brought to light throughout the project by performing small tests along the way to find out what happens when the idea meets reality. This is instead of the more traditional risk management approach of identify all the risks up front, make decisions about the future direction of the project, and only find out if the idea survives contact with reality when the project goes live.

Modern Agile says to ‘Experiment and learn rapidly’. This fits. We can de-risk projects by testing small and testing early, and using the learning to make any course corrections.

Agile or not: dealing with uncertainty

After going to a ‘Scrum of scrums’ meeting this morning, and then watching how we tried to deal with an uncertain situation by trying to find certainty this afternoon, I was thinking about what it means to be ‘doing Agile’.

And in one of those synchronous moments (with the help of Twitter) I stumbled across a blog post called ‘Agile is dead‘. It wasn’t the post, it was the name of the blog that gave me a little light bulb moment; Extreme Uncertainty. It made me remember what Agile is really about. Agile is about dealing with uncertainty.

If you work in two week sprints but your way of working doesn’t help your team or organisation dealing with uncertainty, you aren’t Agile, whether you like it or not. If you do things that help your team or organisation deal effectively with uncertainty, then you’re Agile.

Channel 4: 100 years and counting

Modern Agile vs. traditional and rigid

Modern Agile vs. traditional and rigid

Make people awesome vs. make people fight to be successful

When people often have to fight the organisation in order to let it do the job it hired them to do, how do we create an atmosphere where people feel able to offer their skills and experience to other teams, are empowered to choose the highest impact work, and focus on work that adds real value for customers?

Make safety a prerequisite vs. a culture of risk-aversion

When in a traditional organisation, in a traditional industry, where reputational damage and avoiding any risk of losing customer trust is the greatest concern, how do we help people develop a sense of emotional and professional safety where it’s ok to challenge others, to make mistakes, and try things that help us learn?

Deliver value continuously vs. launch it & leave it

When there’s always something new to be moving onto, another new project or product to launch, how do we build things in a way that means we can develop and improve them to better meet customers changing needs and increase the value we provide?

Experiment and learn rapidly vs. write a business case and get approval

When the process for any new venture is to write a business case, gain support, and get approval from all the right people, how do we move to quickly setting-up experiments so we can learn what customers want and what might work before we put considerable time and effort into building something?

Signing-up for a discount code: the winners and losers

Let’s say you visit an ecommerce website, and up pops a little box that says something like, ‘Subscribe to our newsletter to get 10% discount’. You think to yourself, ‘That sounds like a good deal’, so you enter your email address. And, just as promised, an email arrives with a discount code.

Pop-up coupon

In that simple interaction there are some interesting negotiations and value exchanges going on. The website wants your email address so they can market to get you to buy from them. You might want to buy from them so getting a discount sounds like a good thing to you. Who wins and who loses?

Scenario 1

You ignore the offer and click the x to close the box. Nobody gains or losses anything, but there is failure to gain on both sides. The website didn’t get your email address and you didn’t get a discount code.

Scenario 2

You enter your email address and receive the discount code, but don’t use it as you decide not to purchase from this site. The website makes a little win as they have your email address to market to you in the future, but they didn’t get the bigger win of an order from you. You didn’t win as didn’t get what you were looking for (unless maybe you bought it elsewhere) and you had a little loss as you handed over your email address (but of course you could unsubscribe later).

Scenario 3

You enter your email address and receive the discount code, and place an order using the discount code. The website wins as they got an order (presumably with a margin they can accept) and got your email address to market to you later. You win as you purchased the item you wanted at a discount price.

This kind of cooperative/competitive game play is interesting. Are website owners setting out to create win-win situations with their customers? With a bit of research to understand how customers are approaching a website it isn’t too difficult to understand those value exchanges and create opportunities that help everyone achieve their goals.

Learning a framework for playing Go Fish

I played my first ever game of Go Fish, taught by a ten year old girl who didn’t just teach me how the game works but also showed me a method she had created for making it easier for her to keep track of the sets of cards she’s playing with.

Go fish

She lays the cards face down in a line, left to right, aces to kings, leaving gaps for the cards she doesn’t have, meaning that with a glance she can know which cards she is trying to collect. It helps her focus on the playing of the game as her system keeps track of her cards.

As Go Fish is a game that rewards honesty and cooperation, having the cards visible to other players isn’t a problem, and in fact means that her framework for playing offers a way for deaf and hard of hearing people to play. They don’t need to be able to hear the other players asking for cards and in fact the game can be played in complete silence. When it’s a players turn to ask if any of the other players have a card they can just lift up a card from their row to show to the others. And if they have any of the requested card they hand them over, and then the next player does the same.

It’s a programmers mindset; creating a framework that enables you to solve a problem in a logical and repeatable way. I was very impressed.