blanchonvincent/search-engine-crawler
最新稳定版本:0.4.2
Composer 安装命令:
composer require blanchonvincent/search-engine-crawler
包简介
ZF2 module v0.4.3 - SearchEngineCrawler is a SEO/SEA/SMO crawler.
README 文档
README
Version 0.4.X Created by Vincent Blanchon
Introduction
SearchEngineCrawler is a SEO/SEA/SMO crawler. The crawler use native PHP and several packages from Zend Framework 2.
This project need contributors to keep up to date the project & improve the tests to keep project more stable.
Licence
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Requirement
- PHP 5.3.3
- libxml2 >= 2.7.8, see your version with
php -i | grep "libxml2"
Installation
- Install composer :
curl -sS https://getcomposer.org/installer | php
- Use composer to install the crawler :
php composer.phar require blanchonvincent/search-engine-crawler:dev-master
Usage in native PHP
A simple search on Google Web :
require_once __DIR__ . '/vendor/autoload.php'; $googleWeb = new \SearchEngineCrawler\Engine\Google\Web(); $match = $googleWeb->match('zend framework', 'http://framework.zend.com'); echo sprintf('Link has found in position "%s"', $match->getPosition()); echo sprintf('Link has found in page "%s"', $match->getPage());
You can specify type of links, lang, match options, etc :
require_once __DIR__ . '/vendor/autoload.php'; use SearchEngineCrawler\Engine\Link\Builder\Google\AbstractGoogle as GoogleLinkBuilder; $googleWeb = new \SearchEngineCrawler\Engine\Google\Web(); $match = $googleWeb->match('zend framework', 'http://framework.zend.com', array( 'links' => array('natural', 'image', 'video'), 'builder' => array( 'lang' => GoogleLinkBuilder::LANG_FR, // en by default 'host' => GoogleLinkBuilder::HOST_FR, // com by default ), 'match' => array( 'strictMode' => true, // each uri path must match strictly, true by default 'strictDns' => false, // do not check subdomain, true by default ), )); echo sprintf('Link has found in position "%s"', $match->getPosition()); echo sprintf('Link has found in page "%s"', $match->getPage());
A simple crawl on Google Web :
require_once __DIR__ . '/vendor/autoload.php'; use SearchEngineCrawler\Engine\Link\Builder\Google\AbstractGoogle as GoogleLinkBuilder; $googleWeb = new \SearchEngineCrawler\Engine\Google\Web(); $set = $googleWeb->crawl('rooney', array( 'links' => array('natural', 'image', 'video'), 'builder' => array( 'lang' => GoogleLinkBuilder::LANG_FR, // en by default 'host' => GoogleLinkBuilder::HOST_FR, // com by default ), )); $linkSet = $set->getPage(1)->getLinks(); echo sprintf('There are %s natural links !', count($linkSet->getNaturalResults())); echo sprintf('There are %s image links !', count($linkSet->getImageResults())); echo sprintf('There are %s video links !', count($linkSet->getVideoResults())); foreach($linkSet as $position => $result) { echo 'Position :' . ($position+1); echo 'Link :' . $result->getLink(); echo 'Ad :' . $result->getAd(); }
Features
You can crawl & match:
-
Google Web (natural, image, video, product, premium, bottom premium, map & news)
-
Google Image (image)
-
Google Video (video & natural)
-
Google Book (book & premium)
-
Google News (news, image & natural)
-
Google Shopping (product, premium & bottom premium)
-
Youtube (video)
Page informations available :
- Number of results
- Queries suggest
- Word spelling
Link informations :
- Extension : sitelinks
- Rich snippets : products & price
Tests
- Use ./run.sh to run unit tests
- Use ./debug.sh to run unit tests with stop on failure
- Use ./clean.sh to clean pages results (todo)
Todo
Crawl on :
- Youtube (premium & bottom premium) + metadatas
- Dailymotion
- Google Map
- Google Address
Other stuff:
- Mobile crawler
- Get & improve the rich snippets & extension (rating, phone, author name)
Code :
- Improve the result link type
- Improve workflow
- Improve unit tests with 50+ use case
blanchonvincent/search-engine-crawler 适用场景与选型建议
blanchonvincent/search-engine-crawler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 129 次下载、GitHub Stars 达 25, 最近一次更新时间为 2012 年 12 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 blanchonvincent/search-engine-crawler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 blanchonvincent/search-engine-crawler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 129
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Creative
- 更新时间: 2012-12-07