Professional Documents
Culture Documents
Ce NG 497 Final Reportvfb
Ce NG 497 Final Reportvfb
FACULTY OF ENGINEERING
COMPARISON SHOPPING SITE SYSTEM
By
Ahmet Faruk BKNLER & Mehmet OKYILMAZ
07010441 & 07010321
February 2015
Istanbul, Turkey
ABSTRACT
TABLE OF CONTENTS
ABSTRACT.................................................................................................................................i
TABLE OF CONTENTS.............................................................................................................i
LIST OF FIGURES...................................................................................................................iii
LIST OF TABLES.....................................................................................................................iv
LIST OF SYMBOLS AND ABBREVIATONS..........................................................................v
CHAPTER 1 INTRODUCTION...............................................................................................1
1.1.
Project Overview and Purposes..................................................................................1
1.2.
Scope of Project..........................................................................................................1
1.3.
Success Criteria of Project..........................................................................................1
CHAPTER 2...............................................................................................................................1
BACKGROUND AND MOTIVATION.....................................................................................1
CHAPTER 3...............................................................................................................................3
PROPOSED SYSTEM...............................................................................................................3
3.1.
Project Overview........................................................................................................3
3.2.
Functional Requirements............................................................................................3
3.2.1.
Searching A Product From The Web Site...................................................................3
3.2.2.
Sorting Searched Products..........................................................................................4
3.2.3.
Listing Products..........................................................................................................5
3.2.4.
Narrowing Search Results...........................................................................................6
3.2.5.
Going to Web Site for Selling a Product.....................................................................7
3.2.6.
Create New User.........................................................................................................8
3.2.7.
User Login..................................................................................................................9
3.2.8.
Adding Product by Hand..........................................................................................10
3.2.9.
Adding Product by Uploading XML File.................................................................11
3.2.10. Viewing XML File Uploads......................................................................................12
3.2.11. Viewing XML File....................................................................................................13
3.2.12. Lost Password or Forgetten Password......................................................................13
3.2.13. Banner Upload..........................................................................................................14
3.2.14. Administrator Login..................................................................................................15
3.2.15. Administrator Approves XML Files.........................................................................16
3.3.
Non functional Requirements...................................................................................18
3.3.1.
Usability............................................................................................................18
3.3.2.
Reliability..........................................................................................................18
3.3.3.
Performance......................................................................................................18
3.3.4.
Implementation Platform..................................................................................18
3.4.
System Models..........................................................................................................19
3.4.1.
Use Case....................................................................................................................19
3.4.2.
Activity.....................................................................................................................20
3.4.3.
Relational Database Schema.....................................................................................21
3.4.4.
Entity Relationship Diagram.....................................................................................23
CHAPTER 4.............................................................................................................................24
IMPLEMENTATION...............................................................................................................24
3.4.5.
Comparison Shop System Structure.........................................................................24
4.1.
index.php.......................................................................................................................24
3.4.6.
config.php.................................................................................................................24
3.4.7.
out.php......................................................................................................................24
i
3.4.8.
login.php...................................................................................................................25
3.4.9.
database.php..............................................................................................................25
3.4.10. admin/index.php........................................................................................................26
3.4.11. admin/database.php...................................................................................................26
3.4.12. include/function.php.................................................................................................26
3.4.13. include/geshi.php......................................................................................................26
Handes the code coloring..........................................................................................................26
CHAPTER 5.............................................................................................................................27
CONCLUSION.........................................................................................................................27
CHAPTER 6.............................................................................................................................28
GLOSSARY..............................................................................................................................28
CHAPTER 7.............................................................................................................................29
REFERENCES.........................................................................................................................29
ii
LIST OF FIGURES
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
iii
LIST OF TABLES
Table
Table
Table
Table
Table
Table
Table
Table
Table
iv
DBMS
GUI
URL
PHP
IDE
CHAPTER 1
INTRODUCTION
1.1.
information of the products from different shopping sites, and serves these information to the
users. So the users can find products very fast and easier with using our comparison shop site
system instead of investigating lots of shopping sites. Comparison shopping site system is
composed of two main parts. One of them is crawling part that visits the shopping sites,
gathers information about products and store them into database. Other part is front-end part
that serves information to the customers.
The main purpose of the project is to help the customers to find and buy products by
comparing lots of products from different shopping sites. It allows a smart searching in order
to increase the luck of finding products that are searched by user.
The other purpose of the projects is comparing the products by their prices, in order to
help the users to find the cheapest product.
1.2.
Scope of Project
This system can be used by everyone who wants to make an online shopping.
Generally people can use this system to compare a product in different shopping sites.
CHAPTER 2
BACKGROUND AND MOTIVATION
From the late 1990s, the range of information, products, and services available on the
internet grew massively. At the same time, the popularity of the Internet also grew at a
phenomenal rate. So, the internet became very beneficial platform in terms of making life
easy. Online shopping is one aspect of internet that makes life easy and convenience. Online
shopping is important because it offers buyers convenience that has never before been
achievable. The technology that is now available allows customers to shop on the internet 24
hours a day and seven days a week, without having to leave their homes or offices. Shoppers
are provided with an abundance of merchant sites where almost any goods on earth can be
bought. Consumers can also compare prices from a variety of different retailers with greater
ease, compared to them physically going to shop in a built shopping centre to check prices.
Nowadays, there is a new concept that is more popular that online shopping sites are
Comparison Shopping Sites. The mission of these kinds of sites is to help consumers
anywhere use the power of information to easily find, compare and buy anything online in
less time and for the best price.
There are some problems on comparison shopping sites. The most important problem
is that to gather product information into database of comparison sites and update the database
regularly. Programmers produce different systems in order to solve this problem. One kind of
this system is called web crawler. Web crawler is a program that browses web pages and
filters needed information from these pages. Web crawlers are the core part of the searching
process.
CHAPTER 3
PROPOSED SYSTEM
panel, users will enter search key into the textbox; the search process will start, after pressing
the ARA button.
5.
simple process for users. There are two sorting links; rn and fiyat. User will click one
of sorting links and sorting process will be automatically done by system.
The products are placed unsorted after an search. When user clicks one of the sorting
links, the system will sort products by ascending order. After clinking the link second time,
the system sorts products by descending order automatically.
6.
Listing Products
Twenty products are shown per page. User will check all products page by page by
selecting page number from the bottom menu of the web site.
7.
seller sites. There are 2 menu groups left side of the page for this process. The system allows
multiple narrowing criteria. For example, the user can narrow search of prices between 20
YTL and 300 YTL, after he/she narrowed the search results he/she can also filter an specific
online seller site like alisveris.com. So, the results contain the price between 20 YTL and
300 YTL and only from aliveris.com.
8.
of product for going to the original web site. The system sends the user to the online shopping
site to buy. Buying process will be done in the real site of the product.
9.
10
Click Upload XML from the left menu then browse the xml file finally clicking Upload XML
button will upload the xml to the server.
11
12
13
14
15
16
17
Usability
The system has a simple user interface that makes it user-friendly. In addition to
this, pages loaded very fast because of simplicity.
1.2.
Reliability
If the crawling process is interrupted or stopped because of some unexpected
errors, the crawling process will resume from where the process left.
The user services will be secure; the information that belongs to a user will be kept
in safe.
1.3.
Performance
The simplicity makes the system to load the pages more fast which earns us the
performance.
1.4.
Implementation Platform
Programming
language:
implemented on a Windows PC with Apache Web Server and MySQL Database Server.
The PHPEdit 2.12.2 will be used as an Integrated Development Environment (IDE).
18
19
20. Activity
20
Field Description
Category ID
Category Name
Category Parent ID
Category keywords
Count the number of products in the category
Crawl Table.
Field Name
cid
csellerid
caddress
caddresslabel
cinlinks
coutlinks
cvisited
cvisitdatetime
cpagelength
cparentpage
Field Description
Crawler ID
Seller ID
Crawling Link Address
Crawling Link Address Label
Crawling Link on Comparison Shopping System
Crawler Link out crawled URL
Crawler Link is visited
Crawler visited the URL on which date and time
Web Page length in KB.
The referrer
Users Table.
Field Name
userid
username
password
usermail
phonenumber
Field Description
User ID
User name
User password
User mail
User phone number
21
Favorite Table.
Field Name
userid
productid
Field Description
User ID
Product ID
Search Table.
Field Name
searchtext
counter
Field Description
Searched Text
How many time the user searched this text
Sellers Table.
Field Name
sellerid
fullname
saleinternet
username
password
hitout
crawlwait
crawling
startedcrawling
finishedcrawling
crawledproductcount
crawlcount
Field Description
Seller
Seller full name
Internet address of the seller
Seller user name to login
Seller password to login
Number of times the Seller link is clicked
Seller is in the wait status
Seller is in the crawling status
Seller is in the started crawling status
Seller is in the finished crawling status
Sellers number of products crawled
Seller number of crawled
Products Table.
Field Name
productid
pname
paddress
ppictureaddress
pprice
pmoneyunit
ptaxincluded
pdescription
categoryid
pmodificationtime
sellerid
hitout
Field Description
Product ID
Products Name
Products Address
Products Picture Address
Products Price
Product Money Unit (USD, YTL, EUR)
If the Products Tax Included or Not
Products Description
Products Category Id
Product Modified Time
Product Seller Id
Number of times the product link is clicked
22
23
CHAPTER 4
IMPLEMENTATION
This section of report includes implementation details of Comparison Shop Site
system.
Comparison Shop System Structure
4.1.
index.php
index.php file is the main file of the system. When the web site is opened, this file is run
search() This function takes the search key split it into words and call
formQuery() function in order to create an SQL query for search.
formQuery() This function takes the words and return an SQL query for search.
listing() This function takes the created SQL query runs it and show the
information in the screen.
sayfalama() This function calculate the number of pages that the search results
are shown.
splitText() This function splits search key into words if the search key is
composed of two or more words.
filterWords() This function filters the search key. If they have bad words, the
search process returns zero number of products.
4.2.
config.php
config.php file provides database connection.
24
4.3.
out.php
Out.php file sends the user into the products web page.
4.4. login.php
Shows login form for normal user to login. See Figure 3.2.7.
4.5. database.php
Manages user requires. Like upload XML file.
The XML files has the definition as on table
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE PRODUCTCATALOG[
<!ELEMENT PRODUCTCATALOG (PRODUCTS)+>
<!ELEMENT PRODUCTS (NAME,SHORTDESCRIPTION?,LONGDESCRIPTION?,
UPPERCATEGORY?,CATEGORY?,URL,IMAGEURL?,PRICE,
PRICEVAT,CURRENCYUNIT,SHORTNAME)>
<!ELEMENT NAME ( #PCDATA )>
<!ELEMENT SHORTDESCRIPTION ( #PCDATA )>
<!ELEMENT LONGDESCRIPTION ( #PCDATA )>
<!ELEMENT UPPERCATEGORY ( #PCDATA )>
<!ELEMENT CATEGORY ( #PCDATA )>
<!ELEMENT URL ( #PCDATA )>
<!ELEMENT IMAGEURL ( #PCDATA )>
<!ELEMENT PRICE ( #PCDATA )>
<!ELEMENT PRICEVAT ( #PCDATA )>
<!ATTLIST PRICEVAT kdv CDATA #REQUIRED >
<!ELEMENT CURRENCYUNIT ( #PCDATA )>
<!ELEMENT SHORTNAME ( #PCDATA )>
]>
Table 4.5.8 Document Type Definition
25
An Example file:
4.6.
admin/index.php
Shows login form for administrator user to login. See Figure 3.2.14.
4.7. admin/database.php
Manages administrator requires.
4.8. include/function.php
Includes all the functions used by the database.php classes.
4.9.
include/geshi.php
26
CHAPTER 5
CONCLUSION
To summarize; Comparison Shop Site System is a web crawler e-commerce site. PHP
and MySQL technologies will be used in this project. Basically, the system will do such thing;
Web crawler application will visit different online shopping sites, gather product information
from these sites automatically, and store this information into database. In addition to this,
Comparison Shop Site System will serve comparison feature to users. Then, the information
about products in database will be shown by searching. The results will be compared in
different shopping sites in terms of price. So, this helps online shopping customers to find and
buy cheapest products via internet fast and easily.
27
CHAPTER 6
GLOSSARY
Web Crawler: A web crawler (also known as a web spider or web robot) is a program or
automated script which browses the World Wide Web in a methodical, automated manner.
Many sites, in particular search engines, use spider as a means of providing up-to-date data.
Web crawlers are mainly used to create a copy of all the visited pages for later processing by a
search engine that will index the downloaded pages to provide fast searches. Crawlers can
also be used for automating maintenance tasks on a website, such as checking links or
validating HTML code. Also, crawlers can be used to gather specific types of information
from Web pages, such as harvesting e-mail addresses (usually for spam).
PHP: PHP is a reflective programming language originally designed for producing dynamic
web pages. PHP is used mainly in server-side scripting, but can be used from a command line
interface or in standalone graphical applications. PHP is a widely-used general-purpose
scripting language that is especially suited for Web development and can be embedded into
HTML. PHP generally runs on a web server, taking PHP code as its input and creating Web
pages as output.
MySQL: MySQL is a multithreaded, multi-user SQL database management system. MySQL
is popular for web applications. Its popularity for use with web applications is closely tied to
the popularity of PHP.
PHPEdit: PHPEdit is a commercial IDE developed by WaterProof SARL. It is written in
Delphi and runs on the Microsoft Windows operating system, and is designed mainly for the
PHP language, but supports many other languages such as CSS, HTML, JavaScript, INI,
PHPEditScript, PHP, PlainText, SQL, XML, and XSLT.
28
CHAPTER 7
REFERENCES
1- Web Crawler
http://en.wikipedia.org/wiki/Web_crawler
2- Online Shopping
http://wiki.media-culture.org.au/index.php/Online_Shopping
3
29