定制 c4pone/pagespeed-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

c4pone/pagespeed-parser

Composer 安装命令:

composer require c4pone/pagespeed-parser

包简介

php module to parse pagespeed insights api results

README 文档

README

This simple php module parses the results from PageSpeed Insights API.

Installation

The best way to install the library is by using Composer. Add the following to composer.json in the root of your project:

{
    "require": {
        "c4pone/pagespeed-parser": "dev-master",
    }
}

Then, on the command line:

curl -s http://getcomposer.org/installer | php
php composer.phar install

Use the generated vendor/.composer/autoload.php file to autoload the library classes.

Basic usage

For easy usage we use the pagespeed insights api client from sgrodzicki

<?php

$url = 'http://www.codebuster.de';

$pageSpeed = new \PageSpeed\Insights\Service();
$pageSpeed->getResults($url, 'en_US', 'desktop', array('screenshot' => true));

$parser = new \c4pone\PageSpeed\Parser($pageSpeed->getResults());
$parser->getTitle();
$parser->getPageStats();
$parser->getRecommendations();

$screenshot = $parser->getScreenshot();
$screenshot->save('some/path/screenshot.jpg');

Tests

Build Status

The client is tested with phpunit; you can run the tests, from the repository's root, by doing:

phpunit

Some tests may fail, due to requiring an internet connection (to test against a real API response). Make sure that you are connected to the internet before running the full test suite.

统计信息

  • 总下载量: 75
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固