How to measure the deviation from a competitor's price
I have a large inventory. I want to be able to priorities which books need to be repriced by calculating the books' deviation from the competitors' prices.
I download the source code from a website called bookfinder.com for the particular book that I'm selling.
I want to find the books that are listed as new using a parsing formula.
I want to then isolate which books are not ours using a looping parsing script.
After the parsing finds the book which is in new condition and is not sold by us I would then like to calculate how much our price deviates (higher or lower) from the cheapest competitor's price.
Then I would like to sort the books in terms of this deviation.
To start off with I would like to know how to calculate the deviation.
Then I need help to work out how to make this script loop until it finds a seller's name who does not match our name.