Extract data from google search results

Hello all, I am trying to search for links specific filetypes within a
set of google results. I am not really sure how to explain this, I’ll
try by giving an example.
Say I search for “ajax”, google will give me 10 results, what I want to
do is search within each of those 10 results for all the links with a
specific filetype. say the filetype was .html, I would like to lists all
the links inside those 10 initial results that end with .html.
Something like what the following demos do (their in php):

Thanks in advance, I hope I explained myself ok, any help would be
greatly apreciated,

Regards,

Matt