Component accessors for a sitemap_audit() object. Each returns the stable
tidy shape the package already produces: audit_urls() the read_sitemap()
row tibble, audit_findings() the validate_sitemap() findings contract,
audit_sources() the per-source fetch-metadata records, audit_problems()
the non-fatal parse problems table, and audit_tree() the sitemap_tree()
discovery/index structure.
Arguments
- x
A
sitemap_auditobject, as fromsitemap_audit().
Value
The requested component: a tibble or data frame with the documented columns (zero rows for an empty component).
Examples
xml <- paste0(
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
'<url><loc>https://example.com/</loc></url></urlset>'
)
path <- tempfile(fileext = ".xml")
writeLines(xml, path)
audit <- sitemap_audit(urls = read_sitemap(path))
audit_urls(audit)
#> # A tibble: 1 × 9
#> loc lastmod changefreq priority images video news alternates
#> <chr> <dttm> <chr> <dbl> <list> <list> <list> <list>
#> 1 https… NA NA NA <NULL> <NULL> <NULL> <NULL>
#> # ℹ 1 more variable: source_sitemap <chr>
audit_findings(audit)
#> # A tibble: 0 × 10
#> # ℹ 10 variables: code <chr>, severity <chr>, layer <chr>, subject_type <chr>,
#> # subject_ref <chr>, message <chr>, evidence <list>, mode <chr>,
#> # is_strict_only <lgl>, remediation_hint <chr>
audit_sources(audit)
#> requested_url final_url
#> 1 /tmp/Rtmpd4DRti/file78a2e984b4a.xml /tmp/Rtmpd4DRti/file78a2e984b4a.xml
#> status redirect_chain content_type charset bytes timing error_class
#> 1 NA <NA> <NA> 112 NA <NA>
#> format root namespaces profile_id
#> 1 xml-urlset <NA> <NA>
audit_problems(audit)
#> # A tibble: 0 × 4
#> # ℹ 4 variables: severity <chr>, category <chr>, subject_ref <chr>,
#> # message <chr>
audit_tree(audit)
#> # A tibble: 0 × 8
#> # ℹ 8 variables: depth <int>, parent_sitemap <chr>, sitemap_url <chr>,
#> # page_count <int>, gzip <lgl>, status <chr>, reason <chr>, provenance <chr>