Adding Google's standard search (not custom) to my website

六月ゝ 毕业季﹏ 提交于 2019-12-11 18:13:12

问题


My intention is to embed Google results in my website. I don't want to customise the domain/s on which the search is performed or anything, just a 'bog standard' Google search based on search parameters I pass it.

2 questions:

  • How do I display google results on my website as a response to search criteria entered into a textbox I have?
  • Is there any legislation I need to take into account?

I know my second question sounds rather strange but I'm aware that what I'm appearing to do here is present content driven by Google as though it's my own so want to avoid breaching any copyright or 'same-origin policy' type thing.

What I've Tried/Ways I Know I Could Achieve This

  • Screen scraping Google's response to a simple web request with the necessary query parameters (but seems a bit excessive)
  • Google's custom search (but I don't want to customise anything)

I've tagged this question for some more context.


回答1:


As it is mentioned here

you can use your own XML parser to customize the display for your search users.

with an http request like this:

GET /search?q=bill+material&output=xml&client=test&site=operations 

But it has a limitation on number of requests per day, 500 or 1000 I guess.




回答2:


Custom Search can be configured to include the entire Web in its results:

  1. From the Google Custom Search homepage, click New search engine.
  2. In the Sites to Search box, enter at least one valid URL (e.g. www.google.com).
  3. Click Create.
  4. On the next page, under Optional next steps, click Edit.
  5. On the Basics tab, under Search Preferences, select Search the entire web but emphasize included sites.
  6. Click Save Changes.
  7. In the left-hand menu, under Control Panel, click Sites.
  8. Delete the site you entered during the initial setup process.


来源:https://stackoverflow.com/questions/21816721/adding-googles-standard-search-not-custom-to-my-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!