项目作者: denar90

项目描述 :
Mobile-Friendly API for Node.js
高级语言: JavaScript
项目地址: git://github.com/denar90/mobile-friendly.git
创建时间: 2017-02-01T23:39:59Z
项目社区:https://github.com/denar90/mobile-friendly

开源协议:MIT License

下载


Build Status

Mobile-Friendly Test API for Node.js

Test how easily a visitor can use your page on a mobile device. Just enter a page URL to see how your page scores.

CLI tool and lib to gather results about mobile friendly site using Mobile-Friendly Test API IN BETA.

2 mc administrator administrators-macbook-pro local ---localproject-brunch original bash 2017-02-02 01-21-38

Install

  1. $ npm install --global mobile-friendly
  2. # or
  3. $ npm install --save mobile-friendly

CLI Usage

  1. mbfriendly http://example.com/
  2. # --apiKey Google API key. You don't need to specifiy this option if it's already in process.env.API_KEY
  3. mbfriendly http://example.com/ --apiKey=my_api_key
  4. # --json Reports json details to stdout.
  5. mbfriendly http://example.com/ --json
  6. # returns...
  7. # {
  8. # "testStatus": {
  9. # "status": "MOBILE_FRIENDLY"
  10. # }
  11. # }
  12. # ...
  13. # --requestScreenshot Request for site screenshot
  14. mbfriendly http://example.com/ --requestScreenshot

Read more about Mobile-Friendly Test API

Get Google API key - https://developers.google.com/webmaster-tools/search-console-api/v1/configure

API

  1. const MobileFriendly = require('mobile-friendly');
  2. const mobileFriendly = new MobileFriendly('http://example.com/', opts);
  3. mobileFriendly.run(); // returns Promise

License

MIT © Artem Denysov