龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > SEO优化 >

用Flash 进行Google

时间:2012-12-29 08:41来源:未知 作者:admin 点击:
分享到:
演示: http://www.productbeta.com/google/index.php 当 SOAP的来临和 XML等相似的到来一样 , 站点开发者可以非常容易的从不同的来源提供其他站的更多信息。 为了增加这种方便,许多不同的Web服
演示:http://www.productbeta.com/google/index.php
当 SOAP的来临和 XML等相似的到来一样 , 站点开发者可以非常容易的从不同的来源提供其他站的更多信息。
 为了增加这种方便,许多不同的Web服务提供了API,诸如Google, Amazon, ebay 以及一些你所知道的名字。
 
  Google作为我最喜爱的搜索引擎(以及数百万个互联网网用户的), Flash是我的生计工具,这个想法就是建立一个环境可以使Flash能使用Google并且在该Flash中输出结果。
  基本需求:
  我们需要以下东西建立这个产品
Flash MX
PHP 并有XML支持
Nusoap(PHP小组一种,允许开发者建立使用 SOAP网页服务)
A Google API 账户(可以在这里获得)
  我在这里将不打算介绍SOAP的细节以及如何使用它。在线帮助已经有足够的数据了。无论如何,对XML和它的各种各样的同胞的熟悉是我从读者那里期望的全部。无论如何,我期望读者们能够阅读它。
 不过,通过Nusoap 访问Google之后我将大力推荐在Devshed上的这篇文章。
 
  制作步骤
  第一步,建立一个PHP文件连接到Google,并在Flash环境中获得搜索结果。下面是该文件的原代码。
 这个过程很容易使用Nusoap实现。
 
  <?php
   //Initialize PHP
  
   //include the nusoap class..(http://dietrich.ganx4.com/nusoap/)
   include_once($document.ROOT.“/../scripts/nusoap/nusoap.php“);
  
   /*prints the results of the search in a swf file
   as an array structure to hold ready made data for flash*/
   function google2Flash($searchStr, $startParam=0){
   if(empty($searchStr)) {
   expirationHeaders();
   return;
   }//end if
  
   // create an instance of the SOAP client object
  
   // remember that this script is the client,
   // accessing the web service provided by Google
   $soapclient = new soapclient(“http://api.google.com/search/beta2“;);
  
   setType($startParam, “integer“);
   $maxResults = 10; //Google Limit :(

收藏文章
表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
还没有评论,快来抢沙发吧!

热评话题

按钮 内容不能为空!
立刻说两句吧! 查看0条评论
精彩图集

赞助商链接