2017 © Pedro Peláez
 

library page-speed

Get Google Page Speed data for a given URL

image

calderawp/page-speed

Get Google Page Speed data for a given URL

  • Sunday, August 14, 2016
  • by Shelob9
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Turn URL into Google PageSpeed Results

Requires PHP7, (*1)

Install

composer require calderawp/speed, (*2)

Usage

Get API key and such https://developers.google.com/speed/docs/insights/v1/getting_started, (*3)

    use calderawp\speed\Client;

    $key = 'YOUR KEY';
    $url = 'https://calderawp.com';
    $client = new Client( $url, $key );
    try {
        //If succesful you will have results as stdClass
        $response = $client->query();
    }catch( \Exception $e ){
        return $e->getMessage();
    }

    //Get object of calderawp\speed\Result from results
    //Try/catch above was to prevent this running without valid data, which would make fatal error, which is bad.
    $result = $client->get_result();

The Versions

14/08 2016

dev-master

9999999-dev

Get Google Page Speed data for a given URL

  Sources   Download

GPLv2+

The Requires