开发者

How to display content from other sites on my own page?

开发者 https://www.devze.com 2022-12-18 19:36 出处:网络
How does a website like http://www.dogpile.com display search results from Google and other search engines on it\'s own page. The only way I can think about doing something like this is by using ifram

How does a website like http://www.dogpile.com display search results from Google and other search engines on it's own page. The only way I can think about doing something like this is by using iframes but of course then the content won't really be on 开发者_开发问答my page.


They are using the public api's for the different search engines and building their pages from the results.

See:

Google's Search API
Bing Search API
Yahoo! Search API


Have a look at curl. There are plenty of examples of its usage on that page.


On the server side download the content of their page, make all the relative references absolute, add their head entries to yours, add their body to yours, hope you don't get caught stealing someone else's content.


You could use AJAX, and just consider the remote page as a webservice that returns HTML. That is, just innerHTML it directly into your DOM.


when someone requests a search:

  1. perform that search for the various search engines on your server
  2. extract the content with xpaths, regex, etc
  3. and then display the results on your own webpage
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号