Skip to content

Commit 661b654

Browse files
committed
add Google Structured Data Testing Tool as bot
1 parent e7ff8f7 commit 661b654

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

bots.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,4 @@ YOURLS: "YOURLS"
162162
zelist.ro: "feed parser"
163163
ZIBB: "ZIBB spider"
164164
ZyBorg: "Zyborg? Hmmm...."
165+
StructuredDataTestingTool: 'Google-StructuredDataTestingTool'

test/browser_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,12 @@
952952
end
953953
end
954954

955+
it 'detects Google Structured Data Testing Tool as a bot' do
956+
@browser.ua = $ua['GOOGLE_STRUCTURED_DATA_TESTING_TOOL']
957+
958+
assert @browser.bot?, "Google Structured Data Testing Tool should be a bot"
959+
end
960+
955961
it "knows a supported browser" do
956962
@browser.ua = "Chrome"
957963
assert @browser.known?

test/ua.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ FIREFOX: 'Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubu
2020
FIREFOX_MODERN: 'Mozilla/5.0 (X11; Ubuntu; Linux armv7l; rv:17.0) Gecko/20100101 Firefox/17.0'
2121
FIREFOX_TABLET: 'Mozilla/5.0 (Android; Tablet; rv:14.0) Gecko/14.0 Firefox/14.0'
2222
GOOGLE_BOT: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
23+
GOOGLE_STRUCTURED_DATA_TESTING_TOOL: 'Mozilla/5.0 (compatible; X11; Linux x86_64; Google-StructuredDataTestingTool; +http://www.google.com/webmasters/tools/richsnippets)'
2324
IE10: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; EIE10;ENUSMSN)'
2425
IE10_COMPAT: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; EIE10;ENUSMSN)'
2526
IE10_X64_WINX64: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)'

0 commit comments

Comments
 (0)