Class: Google::Apis::PagespeedonlineV5::PagespeedInsightsService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::PagespeedonlineV5::PagespeedInsightsService
- Defined in:
- generated/google/apis/pagespeedonline_v5/service.rb
Overview
PageSpeed Insights API
The PageSpeed Insights API lets you analyze the performance of your website with a simple API. It offers tailored suggestions for how you can optimize your site, and lets you easily integrate PageSpeed Insights analysis into your development tools and workflow.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#initialize ⇒ PagespeedInsightsService
constructor
A new instance of PagespeedInsightsService.
-
#runpagespeed_pagespeedapi(url, captcha_token: nil, category: nil, locale: nil, strategy: nil, utm_campaign: nil, utm_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PagespeedonlineV5::PagespeedApiPagespeedResponseV5
Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information.
Constructor Details
#initialize ⇒ PagespeedInsightsService
Returns a new instance of PagespeedInsightsService.
48 49 50 51 |
# File 'generated/google/apis/pagespeedonline_v5/service.rb', line 48 def initialize super('https://pagespeedonline.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
41 42 43 |
# File 'generated/google/apis/pagespeedonline_v5/service.rb', line 41 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
46 47 48 |
# File 'generated/google/apis/pagespeedonline_v5/service.rb', line 46 def quota_user @quota_user end |
Instance Method Details
#runpagespeed_pagespeedapi(url, captcha_token: nil, category: nil, locale: nil, strategy: nil, utm_campaign: nil, utm_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PagespeedonlineV5::PagespeedApiPagespeedResponseV5
Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'generated/google/apis/pagespeedonline_v5/service.rb', line 88 def runpagespeed_pagespeedapi(url, captcha_token: nil, category: nil, locale: nil, strategy: nil, utm_campaign: nil, utm_source: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'pagespeedonline/v5/runPagespeed', ) command.response_representation = Google::Apis::PagespeedonlineV5::PagespeedApiPagespeedResponseV5::Representation command.response_class = Google::Apis::PagespeedonlineV5::PagespeedApiPagespeedResponseV5 command.query['captchaToken'] = captcha_token unless captcha_token.nil? command.query['category'] = category unless category.nil? command.query['locale'] = locale unless locale.nil? command.query['strategy'] = strategy unless strategy.nil? command.query['url'] = url unless url.nil? command.query['utm_campaign'] = utm_campaign unless utm_campaign.nil? command.query['utm_source'] = utm_source unless utm_source.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |