Friday, September 16, 2016

Automatic Bike Matcher


This is a small program, i created to aid my cousin with his motorcycle business. It has been a while since he has used it so i am sharing it to the web for anyone who might find the idea or source useful.

Context

There is a website that works like craigslist where people can post ads and people interested in the products will contact the seller. People who want to sell bikes go to this site and post their bikes with all the relevant information.

http://hamrobazaar.com/c62-automobiles-motorcycle


Goal

The goal was to create a software that would match the bikes in the website against the conditions set by the user. A condition is a set of features a user is looking in a bike. The software upon successful match of conditions against the bikes in the site would notify the user  promptly with all the pertinent information regarding the match that would expedite the deal process. For that an SMS could be sent to the user using an external SMS service such as https://www.clickatell.com/ .


Structure of the Program


The program has 4 main parts. A server written in python.  Clients in html.


1) Client - Conditions Entry Page

The most important UI for the user is the data entry page or the conditions entry page. In the entry page, i can set the conditions i am looking for. For example: "I am in search of a Pulsar bike whose price ranges from 100000 to 250000.".  I will set the conditions as shown below.




There is a submit button at the bottom of the page. After submitting the form, the user is redirected to a  conditions listing page.

2) Client - Conditions listings

This is a page that will list all the conditions that have been set by the user. I may be looking for multiple bikes each one with a set of conditions. In the example below, we have three conditions set.



3) Client - Matches listings

This is the results page that lists all the matches in chronological order starting with the latest matches which will be shown at the top and the old matches moving down the list. Another important feature of this page is that the most recent matches that the user has not seen yet will be highlighted in green.



4) Server - Bike Matcher

The core logic of comparing and notifying the user of any matches against the user's conditions is handler by a server written in python.

The server runs 24 hours a day and sleeps every 1 minute or so. The sleep or wakeup rate can be adjusted to suit one's needs. The server scraps data from the hamrobazaar site and it maintains a queue of the most recent bikes that have been added to the site. It will then proceed to the matching phase. It will match all new bikes to the conditions set by the user.

The server picked the best match among all the recent matches. This was done deliberately to prevent flooding the user with SMSs which would not be efficient. So in order to pick the best match, the matches are sorted according to priorities. The properties of the matches are normalized and then the best value match is selected to be sent to the user. The best match is sent to the user via an SMS. The SMS contains crucial information such as name and contact number of the seller so that as soon as the SMS is received the seller can be contacted via a cell phone to make the deal.



Server running...





External Services Used

https://www.clickatell.com/




Download Package


Friday, September 9, 2016

My First Android App






Created a simple hangman game for my first android app. Below is the play store link for install.

Download App