Assignment title: Information
`CSG5116 – Advanced Scripting
Major Assignment
Assessment Note: This workshop forms part of the Major Assignment assessment
Task
Write a script, which checks prices on two websites which sell video games. The script will need to make use of a database backend and allow for historic pricing to be retrieved. The script may be developed in any of the languages covered in the unit.
You will need to select the two video game retailers, it is suggested that you review the formatting of pages to ensure a site that is consistent and scrapable without an undue amount of additional work. In order to meet the requirements for this assignment they should also have functionality to search for products.
• The script will need to perform a search on the sites selected for a product.
• The script will need to store the date, time, site, product name & price in a database.
• When storing details of an item the script will assign an item number, all future prices for this item will be stored with the same item number.
• The script will repeat this search whenever it is run with the update parameter
o On first execution the update parameter should create the database and perform the initial price check.
o On subsequent execution the prices should be updated and a new entry inserted in the database
• The script will accept a search parameter, which searches the local by product name and displays results.
• The script will accept the history parameter with a second parameter of an item number, it will then display historic prices for that item.
Example commands*:
$ python pricewatch.py update
Detected first run, creating database
Updating prices from Site A
Site A update complete, 23 prices inserted
Updating prices from site B
Site B update complete, 42 prices inserted
$ python pricewatch.py search widget
----------------------------------------------------
| # | Name | Store | Price |
----------------------------------------------------
| 22 | Fancy Widget | Site A | $63.30 |
| 31 | Normal Widget | Site A | $33.90 |
| 42 | Normal Widget | Site B | $21.15 |
----------------------------------------------------
$ python pricewatch.py history 22
Showing history for "Fancy Widget", from Store A
-------------------------------
| Date | Time | Price |
-------------------------------
| 11/03/2012 | 11:22 | $56.40 |
| 12/03/2012 | 23:14 | $99.95 |
| 15/03/2012 | 01:08 | $63.30 |
-------------------------------
*Note all example commands are assuming that you are writing the software in python, please assume the equivalent for whichever language you select.
You may hard code the details of the sites, regular expressions and the search term you wish to use
Submission Requirements
The created script should be submitted with the name pricewatch to the major assignment section under assessments on blackboard
Notes
Your work must comply with ECU referencing guidelines and plagiarism policy