Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ Agentry::Bot.matchers << ->(ua, _browser) { ua.match?(/externalhit/i) }
[Bots page](https://levups.github.io/agentry/bots.html#matchers) shows how to remove the built-in matchers or go
back to the detection of browser 2.x.

Change these lists while the app boots, in an initializer, before any thread detects a user agent. Every
detection reads them without a lock, so a change made while requests run can raise or go unseen, above all on
JRuby and TruffleRuby, whose threads run in parallel. Agentry's own caches are safe to share between threads
on every Ruby.

### Verified crawlers

Anyone can send `Googlebot` as their user agent. Google, Bing, OpenAI, Apple, Perplexity and DuckDuckGo publish the
Expand Down
1 change: 1 addition & 0 deletions docs/bots.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ <h2 id="matchers-title">Matchers</h2>
<p>To start from nothing, <code>Agentry::Bot.matchers.clear</code>; to get the built-in ones back, <code>Agentry::Bot.matchers.concat(Agentry::Bot.default_matchers)</code>. To restore browser 2’s detection, remove the keyword and empty user agent matchers:</p>
<pre><code class="language-ruby"><span class="no">Agentry</span><span class="o">::</span><span class="no">Bot</span><span class="p">.</span><span class="nf">matchers</span><span class="p">.</span><span class="nf">delete</span><span class="p">(</span><span class="no">Agentry</span><span class="o">::</span><span class="no">Bot</span><span class="o">::</span><span class="no">KeywordMatcher</span><span class="p">)</span>
<span class="no">Agentry</span><span class="o">::</span><span class="no">Bot</span><span class="p">.</span><span class="nf">matchers</span><span class="p">.</span><span class="nf">delete</span><span class="p">(</span><span class="no">Agentry</span><span class="o">::</span><span class="no">Bot</span><span class="o">::</span><span class="no">EmptyUserAgentMatcher</span><span class="p">)</span></code></pre>
<p>Change the matchers and the bot lists while the app boots, in an initializer, before any thread detects a user agent. Every detection reads them without a lock, so a change made while requests run can raise or go unseen, above all on JRuby and TruffleRuby, whose threads run in parallel. Agentry’s own caches are safe to share between threads on every Ruby.</p>
</div>
</section>

Expand Down
7 changes: 7 additions & 0 deletions docs/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ Agentry::Bot.matchers << ->(ua, _browser) { ua.match?(/externalhit/i) }
[Bots page](https://levups.github.io/agentry/bots.html#matchers) shows how to remove the built-in matchers or go
back to the detection of browser 2.x.

Change these lists while the app boots, in an initializer, before any thread detects a user agent. Every
detection reads them without a lock, so a change made while requests run can raise or go unseen, above all on
JRuby and TruffleRuby, whose threads run in parallel. Agentry's own caches are safe to share between threads
on every Ruby.

### Verified crawlers

Anyone can send `Googlebot` as their user agent. Google, Bing, OpenAI, Apple, Perplexity and DuckDuckGo publish the
Expand Down Expand Up @@ -478,6 +483,8 @@ Agentry::Bot.matchers.delete(Agentry::Bot::KeywordMatcher)
Agentry::Bot.matchers.delete(Agentry::Bot::EmptyUserAgentMatcher)
```

Change the matchers and the bot lists while the app boots, in an initializer, before any thread detects a user agent. Every detection reads them without a lock, so a change made while requests run can raise or go unseen, above all on JRuby and TruffleRuby, whose threads run in parallel. Agentry’s own caches are safe to share between threads on every Ruby.

### Extending the lists

```ruby
Expand Down