How to search through online сhеss games using AppleScript or Automator

applescriptautomator

I would like to search for specific online сhеss games. Each game has a single adress. Since there are millions of games on instant chess, it would take far too long to index all the games. So I will set a limit and use the script at night. Conditions should be something like this:

http://www.instantchess.com/?EXP=1&GPI=84094532

To start, could the script search games 84094532 to 84095000 and store the web addresses of all the games with Reti opening in them so I could see the games by myself during the day?

Best Answer

Thank you for trying to help me but someone has already done it. This question can be marked as solved. Here is his script (all credit goes to him):

set retiList to {}
set theStart to 84094500    
set theEnd to 84094600   
repeat with gameRef from theStart to theEnd    
  set theScript to ("curl 'http://www.instantchess.com/?EXP=1&GPI=" & gameRef as string) & "'"
  set theSource to do shell script theScript
  if theSource contains "reti" then
   set end of retiList to gameRef
  end if
end repeat
retiList