I'm do开发者_运维问答ing a webpage about apples (the fruit), I want to include Google search results for apple recipes on the bottom of the page. How can I do this?
For more advanced inclusion of Google results check out this: https://developers.google.com/web-search/docs/#fonje
You can use ajax based search queries for your keywords and put the results on your website. There are examples in the docs
Update:
As the API is deprecated you can now alternatively just scrape the results from Google instead of using their API.
There is an open source PHP scraper that can be included into your website at http://scraping.compunect.com
You can accomplish this using iframes, but you might want to consider some alternatives... you might want to create a Google Custom Search Engine to serve results only from recipe websites. And, instead of using a frame to display results, you might want to simply make the custom search engine available, so that, only if a user is interested in finding a recipe, he/she may do so. Something else to consider... you might want to monetize this, in which case using Google AdSense would be the way to go.
<iframe src="http://www.google.com/search?q=apple+recipe" />
If you want to use an iframe, you can use the code above; however, this is not a good design decision.
<a href="http://www.google.com/?q=apples">See recipes about bananas</a>.
精彩评论