Google の robots.txt パーサーがオープンソースに
2019 年 7 月 1 日(月曜日)
Robots Exclusion Protocol(REP)は 25 年にわたり、事実上の標準にすぎなかったため、時には不便を感じることがありました。ウェブマスターにとっては、テキスト エディタで robots.txt ファイルに BOM 文字が含まれていた場合などの特殊なケースにおいて不確実な状況が発生していました。一方、クローラとツールの開発者にとっても、robots.txt ファイルが数百メガバイトもある場合、どのように対処すべきなのか、といった不確実性をもたらしていました。
本日、Google は REP をインターネット標準にするための取り組みを率先して行っていることを発表しました。これは重要なステップですが、robots.txt ファイルを解析するデベロッパーにとっては追加の作業が必要になることが予想されます。
これについて、サポートのご案内をいたします。Google は、本番環境システムが robots.txt ファイルのルールの解析と照合に使用する C++ ライブラリをオープンソース化しました。このライブラリはリリースされてから 20 年余りが経過しており、90 年代に書かれたコードが含まれています。それ以降、このライブラリは発展してきました。Google は、カバーする必要があるウェブマスターが robots.txt ファイルを作成する方法と、特殊なケースについて多くのことを学びました。そして、何年にもわたって学んだことを、理にかなったインターネット ドラフトにも追加してきました。
また、オープンソース パッケージには、いくつかのルールをテストするためのテストツールも用意されています。一度構築すれば、使い方は非常に簡単です。
robots_main <robots.txt content> <user_agent> <url>
ライブラリを確認する場合は、robots.txt パーサーに関する GitHub リポジトリをご覧ください。このライブラリをぜひご活用ください。ライブラリを使用して作成したものがあれば、Twitter でコメントをお寄せください。また、ライブラリに関するご意見やご質問がございましたら、GitHub をご利用ください。
Posted by Edu Pereda,
Lode Vandevenne, and
Gary Illyes, Search Open Sourcing team
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
[null,null,[],[[["The Robots Exclusion Protocol (REP), used for controlling web crawler access, is becoming an internet standard after 25 years as a de-facto standard."],["Google open-sourced their C++ robots.txt parsing library to aid developers in implementing the standardized REP."],["The open-sourced library incorporates 20 years of Google's experience and knowledge in handling robots.txt files and edge cases."],["A testing tool is included within the open-source package to facilitate easy verification of robots.txt rules."],["Developers are encouraged to utilize the library and share their creations or feedback with Google."]]],["Google is leading efforts to formalize the Robots Exclusion Protocol (REP) as an internet standard, previously only a de-facto standard. They have open-sourced their C++ library, used for 20 years to parse and match rules in robots.txt files, to assist developers. This library now includes a testing tool, `robots_main`, for checking rules. Developers can engage with Google via GitHub and Twitter. The aim is to address past uncertainties.\n"]]