Initial commit of PHP code. It works good enough for testing. Still needs some small fixes such as duplicate checking etc.
There is a readme file with some info on the links.