<?php // Plug-in 76: Search Yahoo!
/** Yahoo!搜索* 插件说明:* 插件接受一个搜索串,返货Yahoo!搜索引擎的搜索结果。* 若搜索成功,则返回一个两元素数组,第一个元素表示返回结果的个数,第二个元素是一个数组,保存搜索结果,* 每个元素都是一个子数组,它具有以下值:*    标题*    摘要*    需要显示的URL地址*    用于单击的URL地址* 搜索失败,返回一个元素的数组,元素的值为FALSE.* 本插件需要以下参数:* $search 搜索串* $start 返回的第一个结果* $count 返回结果的最大个数*/
// This is an executable example with additional code supplied
// To obtain just the plug-ins please click on the Download link$search  = "yahoo search api";
$results = PIPHP_SearchYahoo($search, 1, 10);
echo "<font face='Arial' size='2'>Searching Yahoo! for: " ."<b>$search</b>:<br /><br />";if (!$results[0]) echo "No matching results found for $search.";
elseforeach($results[1] as $result)echo "<a href='$result[3]'>$result[0]<a/><br />"."$result[1]<br />" ."<font color='green'>$result[2]</font><br /><br />";function PIPHP_SearchYahoo($search, $start, $count)
{// Plug-in 76: Search Yahoo!//// This plug-in returns results from the Yahoo1 search// engine based on the query in $search, which can be// any standard Yahoo! search query. Up to 50 results can// be returned at a time. Upon success it returns a two// element array, the first of which is the value TRUE,// and the second is an array, each element of which// contains a sub-array containing the four items in// each search result: title, abstract, display url, and// click url. On failure it returns a single element// array with the value FALSE. It requires the following// arguments:////    $search: A search query//    $start:  The result number from which to start//    $count:  The number of results to return$search = rawurlencode($search);$id     = 'YourAPIKeyMustGoInThisStringOrItMayFail';$url    = 'http://boss.yahooapis.com/ysearch/web/v1/' ."$search?appid=$id&format=xml&start=$start" ."&count=$count";$xml  = @file_get_contents($url);if (!$xml) return array(FALSE);$xml  = str_replace('<![CDATA[',        '', $xml);$xml  = str_replace(']]>',              '', $xml);$xml  = str_replace('&', '[ampersand]', $xml);$xml  = str_replace('&',           '&', $xml);$xml  = str_replace('[ampersand]', '&', $xml);$xml  = str_replace('<b>',     '<b>', $xml);$xml  = str_replace('</b>',   '</b>', $xml);$xml  = str_replace('<wbr>', '<wbr>', $xml);$sxml = simplexml_load_string($xml);$data = array();foreach($sxml->resultset_web->result as $result){$t = html_entity_decode($result->title);$a = html_entity_decode($result->abstract);$d = html_entity_decode($result->dispurl);$c = $result->clickurl;if (strlen($a)) $data[] = array($t, $a, $d, $c);}return array(count($data), $data);
}?>

插件76:Yahoo!搜索相关推荐

  1. 【Flutter】Flutter 项目中使用 Flutter 插件 ( Flutter 插件管理平台 | 搜索 Flutter 插件 | 安装 Flutter 插件 | 使用 Flutter 插件 )

    文章目录 一.Flutter 包和插件管理平台 二.Flutter 插件搜索示例 三.Flutter 插件装示例 1.添加 Dart 包依赖 2.获取 Dart 包 3.使用 Dart 包 4.官方的 ...

  2. wordpress常用插件打包 百度搜索推送插件+sitemap生成等

    简介: wordpress常用插件打包 百度搜索推送插件+sitemap生成+七牛云对象存储+评论防护 一.WordPress 七牛云对象存储(简称:WPQiNiu),基于七牛云对象存储与 WordP ...

  3. 插件79:搜索Google图书

    <?php // Plug-in 79: Search Google Books /** 搜索google图书* 插件说明:* 插件接受一个搜索串,返回在Google图书数据库中找到的图书.* ...

  4. 如何把网站加入百度、google、Yahoo搜索、一搜、搜狗、中搜、爱问等搜索引擎.

    如何把网站加入百度.google.Yahoo搜索.一搜.搜狗.中搜.爱问等搜索引擎. 1.加入百度搜索:打开http://www.baidu.com/search/url_submit.html 然后 ...

  5. Elasticsearch如何修改拼音分词插件支持音调搜索

    背景 es默认加载的拼音分词插件是不支持音调搜索的,如何修改插件使得它支持音调搜索?又或者多音字你想要默认的读音是另外一个,例如曾默认读音是ceng,我想修改其默认读音为zeng. 下载拼音分词插件代 ...

  6. Google Baidu 和 Yahoo 搜索PK

    为了论文看了下行为模式不小心看到了搜索巨头们打算将行为模式用于算法中,同时也就看到了不少其介绍.原来一直喜欢用Google觉得好但是没有测试过.现在测试一下: 测试内容"龙荣林的博客&quo ...

  7. google,百度,yahoo搜索比较

    最近专注于搜索网站的分析,今天早上写了一篇:计算机面试笔试题--如何找到最合适的女朋友, 刚才一时好奇,用各大搜索引擎搜了一下:计算机面试笔试题,结果百度对中文新文反应最快. 在百度中,我得文章排在第 ...

  8. 油猴插件导致bing搜索显示“cn.bing.com“重定向次数过多

    首先参照微软官方建议删除cookie.在 Microsoft Edge 中删除 Cookie - Microsoft 支持 所有步骤都尝试,所有记录都删除后发现没有解决任何问题. 然后csdn刷到这个 ...

  9. 百度,google,yahoo搜索比较

    最近专注于搜索网站的分析,今天早上写了一篇:计算机面试笔试题--如何找到最合适的女朋友, 刚才一时好奇,用各大搜索引擎搜了一下:计算机面试笔试题,结果百度对中文新文反应最快. 在百度中,我得文章排在第 ...

最新文章

  1. 病毒周报(100308至100314)
  2. PHP与SQL注入***(实战篇五)
  3. ubuntu18.04 出现 Command ‘ifconfig‘ not found 问题的解决办法
  4. Windows 10如何禁用Microsoft Edge标签页预览
  5. draw.io创建自定义形状
  6. 【AWSL】之Linux进程和计划任务管理(ps、top、pgrep、pstree、pkill、at、crontab)
  7. 极点五笔状态栏的隐藏和显示的快捷键
  8. 灰色关联法 —— python
  9. SpringCloud Hoxton版微服务- Gateway网关
  10. vue-cli 使用Mint-UI
  11. ❤️稀疏数组的建立与还原(建议收藏)❤️
  12. 58. web 攻击技术(2)
  13. netty 使用阻塞发送_「解」互联网大厂Java面试题——Netty 面试题解析
  14. JxBrowser做爬虫时处理浏览器对话框
  15. 一阶梯度法、二阶段梯度法、牛顿法
  16. 模拟CMOS集成电路设计 学习笔记(一)
  17. error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools“
  18. 一文读懂局域网、广域网、WLAN、WiFi的联系与区别
  19. IDEA+Java控制台实现医院管理系统
  20. 如何快速传输大文件,介绍大文件快速方法

热门文章

  1. 联想Tab M10 FHD PLUS (TB-X606F)解锁BL,获取root权限(无需第三方recovery),刷xp框架(太极-阳)适用大部分联发科CPU(国际版rom底包)
  2. 关于家用摄像头,你想知道的都在这
  3. 人工智能力助量子误差矫正
  4. easyui的数据网格实现多条件查询并显示数据
  5. Unity2D~对周目解密小游戏练习(三天完成)
  6. SVN多版本库环境的搭建
  7. Smardcard Reader+D8射频卡读写演示测卡。
  8. 实验二:通过SQL语句创建与管理数据表
  9. python 回文素数
  10. 算法设计与分析—— 动态规划法