I have a PHP script which takes the name of the domain from the url and searches and extracts Overture keyword suggestions from it and prints them to a text file. I would like it to dig one level deeper instead of just returning the primary results. For instance if the domain was [url removed, login to view] it returns "credit cards, credit card offers, apply for a credit card, etc" and writes them to the text file. I want to not only save those terms to my text file but also search those terms in Overture and add them to the keyword text file as well so I can get the "long tail" terms as well as the main ones. Please see the attachment for the code I am currently using.
Should be an easy job for a PHP expert. Need it done fast.