Native Shell
Native Shell:AI 生成的 UI,在你的应用中原生呈现,覆盖每个平台。iOS、Android、macOS、Windows 与 Linux 上的应用、GPUI 应用与网页在运行时加载已签名、沙箱隔离的 TSX 模块并绘制 th
AI 翻译
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Read-only mirror of gitlab.com/bart-turczynski/robotstxtr
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Faithful robots.txt parsing and URL-allowed decisions for R, powered
by Google’s own matcher.
robotstxtr evaluates whether a URL may be crawled according to a
site’s robots.txt rules. It wraps a vendored, upstream-test-validated
snapshot of Google’s open-source C++ robots.txt parser and matcher, so
allow and disallow decisions match Googlebot’s behavior — including the
quirky parts (longest-match wins, Allow-beats-Disallow ties, */$
wildcards, case-sensitive paths, percent-escape canonicalization). It
can also fetch robots.txt for you under a deterministic, conservative
policy, through the ssrfr guard against server-side request forgery,
construct fetch origins with rurl, and return richly typed, vectorized
decisions with per-rule match metadata.
This is a faithful, upstream-test-validated replica of the pinned matcher, not a claim of universal behavioral identity with Googlebot.
Install the released version from CRAN:
install.packages("robotstxtr")
Or the development version from r-universe:
install.packages(
"robotstxtr",
repos = c("https://bart-turczynski.r-universe.dev", "https://cloud.r-project.org")
)
The development version also lives on GitLab. Its dependencies,
including rurl, are all on CRAN, so it installs with no extra
repository configuration:
# with pak
pak::pak("gitlab::bart-turczynski/robotstxtr")
# or with remotes
remotes::install_gitlab("bart-turczynski/robotstxtr")
Installing from source compiles the vendored C++ matcher and requires a C++17 toolchain. Once dependencies have been obtained, installing, testing, and checking the package does not make live network requests.
Match one or more URLs against a robots.txt body you already have,
fully offline, with allowed_by_robots_text():
library(robotstxtr)
robots <- "user-agent: *
disallow: /private
allow: /private/public
"
x <- allowed_by_robots_text(
robots,
c(
"https://example.com/index.html", # not disallowed -> TRUE
"https://example.com/private/report", # under /private -> FALSE
"https://example.com/private/public" # re-allowed -> TRUE
),
"mybot"
)
x$results[c("url", "allowed", "decision_source")]
#> url allowed decision_source
#> 1 https://example.com/index.html TRUE default_allow
#> 2 https://example.com/private/report FALSE rule_disallow
#> 3 https://example.com/private/public TRUE rule_allow
allowed is the TRUE/FALSE/NA answer; decision_source explains
why.
If you do not already have the robots.txt text,
allowed_by_robots_url() derives the governing origin, fetches it once
per origin, and matches:
allowed_by_robots_url("https://example.com/some/page", "mybot")
See the “Introduction to robotstxtr” vignette for the full walkthrough,
including match metadata, the fetch policy, and body inspection with
robots_body().
Document validation is separate from URL allow/disallow evaluation.
Validate supplied text (or raw acquisition bytes) with
robots_validate_text():
validation <- robots_validate_text(
"user-agent: *\ndisallow: /private\nunknown-field: value\n"
)
validation$documents
validation$diagnostics
Use robots_validate_url() when the document must first be fetched. It
calls the same deterministic robots_fetch() path and validates each
distinct stored raw body once; acquisition limits and failures remain
explicit evidence.
The profile is deliberately named google-parser-compatible. It
describes the pinned parser plus conservative structural checks, not
universal crawler or RFC 9309 validity. Validation reports file syntax
and structure only: it does not answer whether a particular URL is
allowed, infer whether rules match the webmaster’s intent, or fetch and
check remote sitemap resources.
Multi-engine integrations should use the versioned facade,
robots_evaluate_text_v1() and robots_evaluate_url_v1(), which
selects the engine policy and the matcher (Google, Yandex or Bing)
explicitly and returns explicit non-decisions instead of falling back to
Google. The “Engine-aware contract” vignette walks through it.
If you use robotstxtr in your work, please cite it. Run
citation("robotstxtr") for the current citation, or see
CITATION.cff.
Each release is archived on Zenodo. Cite the concept DOI
10.5281/zenodo.23018995 to
refer to robotstxtr in general; it always resolves to the latest
release. Use the version-specific DOI shown on the Zenodo
record for a particular
release.