1) Script should be written entirely in C or C++ and run under Linux shell. It must use threads and connect to feed in fastest posible way (socket)
2) It will be executed from PHP via system() or passthru() command, with 2 parameters: KEYWORD and IP_ADDRESS
3) Script should look for file KEYWORD. If file exists it must read its contents
For example: if keyword is lcd tv than file lcd tv will look like:
best lcd#cheap lcd#panasonic lcd#sony lcd
Now using threads for each of above keywords (separated by #) AND for main keyword script should connect to:
[url removed, login to view];ip=IP_ADDRESS&keyword=KEYWORD
(i.e. [url removed, login to view];ip=18.104.22.168&keyword=sony+lcd)
This will return feed, with different information separated by |and new lines (n).
For each line elements are (as they would appear in array)
4) url where click should be sent
You must then sort all results by highest bid descending. Result_number value must be unique
(i.e.: I dont want 5 first results to be #1 results from each of the keywords)
Final feed with best paid keywords should be printed to STDIO in exacly the same format as feed from feed.peakclick.com.
Thats basic idea how it should work.
Id like to have 2 additional possibilities in constructing feed
1) If file KEYWORD has more than X keywords separated by # I must be able to limit for how many of them we construct feed and make threads (if there will be 10 keywords, it may use too much resources to generate feed, so Id like to limit if globally to first Y elements
2) If file KEYWORD does not exists we get feed for original keyword and print it. We also log non existant file to specifed directory (ie /home0/htdocs/domain/[url removed, login to view])