ps_simple_2_vec: Download Pagespeed v4 raport for multiple URLs as one data...

Description Usage Arguments Details Value Examples

View source: R/ps_simple_2_vec.R

Description

This function can check multiple URLs given in a vector and parse them into a one data frame. This data frame doesn't contain all the possible information from Pagespeed as response cannot be simply parsed into tabular form, but it contains most of the metrics, recommendations and error occurences.

Usage

1
2
3
4
ps_simple_2_vec(url, key = Sys.getenv("PAGESPEED_API_KEY"),
  strategy = NULL, interval = 0.5, filter_third_party = NULL,
  locale = NULL, rule = NULL, screenshot = NULL, snapshots = NULL,
  utm_campaign = NULL, utm_source = NULL)

Arguments

url

vector of character strings. The URLs to fetch and analyze

key

string. Pagespeed API key to authenticate. Defaults to "PAGESPEED_API_KEY" enviroment variable.

strategy

string. The analysis strategy to use. Options: "desktop" or "mobile". Defaults to "desktop"

interval

numeric. Number of seconds to wait between multiple queries. Defaults to 0.5 second.

filter_third_party

logical. Indicates if third party resources should be filtered out before PageSpeed analysis. Defaults to NULL (= FALSE)

locale

string. The locale used to localize formatted results

rule

string. A PageSpeed rule to run; if none are given, all rules are run

screenshot

logical. Indicates if binary data containing a screenshot should be included. Defaults to NULL (= FALSE)

snapshots

logical. Indicates if binary data containing snapshot images should be included. Defaults to NULL (= FALSE)

utm_campaign

string. Campaign name for analytics. Defaults to NULL

utm_source

string. Campaign source for analytics. Defaults to NULL

Details

This function uses legacy version 4 of the API. Check function lh_simple_2_vec() for version 5. If you need all the information but in form of a nested list, use ps_raw_2_vec().

Value

formatted data frame

Examples

1
2
3
4
## Not run: 
multiple_urls_simple_output <- ps_simple_2_vec("https://www.google.com/")

## End(Not run)

Leszek-Sieminski/pagespeedParseR documentation built on May 12, 2021, 2:29 p.m.