GithubHelp home page GithubHelp logo

uvacoder / readme-pagespeed-insights Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ankurparihar/readme-pagespeed-insights

1.0 0.0 0.0 39 KB

Google lighthouse stats of your website that you can put in readme

Home Page: https://pagespeed-insights.herokuapp.com

License: Apache License 2.0

JavaScript 100.00%
myreadme

readme-pagespeed-insights's Introduction

PageSpeed Insights for README

Embed your website's pagespeed score to your readme

About PageSpeed Insights

PageSpeed Insights analyzes the content of a web page, then generates suggestions to make that page faster. Learn more.

Info

Guages

PWA

API and Usage

Important note: Do not embed url to readme, instead embed generated svg

  • It takes time to perform audits of website. So embedding it directly in readme would not render due to server timeout. Instead you must first visit and download the svg from the api (by simply visiting api url with desired parameters). And then embed that svg to your README files.
  • Typically it takes 10-15 seconds to obtain the results from pagespeed api
  • Some servers don't allow (eg. google.com) or delay (eg. cloudflare) pagespeed crawler, so it may result in unexpected results.
  • The result may fluctuate slightly sometimes.

API url

The api is called from https://pagespeed-insights.herokuapp.com

Simple usage

In simple form it will return result for all categories for desktop version of your website. Replace your_website_url with your website's url

https://pagespeed-insights.herokuapp.com?url=your_website_url

For example

https://pagespeed-insights.herokuapp.com?url=https://ankurparihar.github.io

Theme

Default result is theme-agnostic i.e. looks good in both light and dark environment. But you can force one of two additional themes that are light and dark.

https://pagespeed-insights.herokuapp.com?url=your_website_url&theme=dark

Strategy

Strategy specifiec the type of device your website is audited for. You can specify strategy as either mobile or desktop. If none is specified desktop is chosen

https://pagespeed-insights.herokuapp.com?url=your_website_url&strategy=mobile

Category

There are 5 categories (in order)

  • Performance
  • Accessibility
  • Best Practices
  • SEO
  • Progressive Web App

By default all the categories are evaluated, but you can specify which categories to evaluate. The category parameter is a number. This is 5-bit number in binary, where if a bit is 1 then the corresponding category will be included. For example

+------------+------------+------------+------------+------------+
|   Perf.    |    Acc.    |  Best pr.  |     SEO    |     PWA    |
+------------+------------+------------+------------+------------+
|      1     |      0     |      1     |      1     |      1     | => 0x10111 => 23
+------------+------------+------------+------------+------------+

Embedding into readme

After downloading svg you can embed into readme as following

  • markdown method
![alt text](path/to/svg "tooltip text")
  • html method
<p align="center">	<!-- (optional) center align -->
    <img src="/path/to/svg" width="XXXpx">
</p>

Example

readme-pagespeed-insights's People

Contributors

ankurparihar avatar jezorko avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.