Sotware Documentation
Business Logic
Main Page
RunToShop uses a tag based recommendation system. When recommendations are added into the system, tags are added automatically to the recommendations that it would make the search and the categorisation of the recommendations easier.
When the user makes a search on the site, these tags are taken into use. The search term is probed against a tags of the recommendations. If it finds any recommendation that it has the same tag, it prints that recommendation on the page.
The tags are also used during a search: putting out banners on the site. Tags are also connected to banners. When the end user makes a search, the search term is used to find if any of the banners has a tag with the same word. It finds all the banners that has tags and uses the pricing of the banners to count with what probability the banner would show up on the page.
probability of a banner = (price of the banner / total price of all the banners that have the same tag attached to it)
Blog Page
The logic applied on the blog page can be easily implemented on any other pages where the user does not directly interacts with the page (does not start a search).
The before the page is printed out, the page is processed:
- all the HTML tags are stripped away
- all the numbers and punctuations are stripped away
After the processing the page, all the words that could be read on the page are stored (in an array) for further processing. The words are matched against the tags of the banners. Whenever a match is found, it is stored. If a banner has the tag "televisio" and the word "televisio" is shown on the page 2 times, then it means two matches for that banner tag. The process checks for all the available tags. The tag which shows up most on the page will define which banner to print.
The tag is selected, based on which is the most relevant on the current page. Then all the banners with that tag is selected. The probability which would finally show on the page is defined the same way as it is described above, in the Main Page section.