isbot 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/bin/isbot +7 -0
- data/{lib/fetch.sh → fetch.sh} +1 -1
- data/isbot.gemspec +4 -3
- data/tests/isbot_test.rb +2 -2
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 379d67b37eaedcd41284a4f047a4982c4c914e30
|
|
4
|
+
data.tar.gz: fc33bf369f402c899bf1ed5c1dbea4dd8667fde4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9806ad2d0580d92842701eff286137ad5ca3e16d1dacef4ead90b2ca095b92dd7dc5d6db7c87bdd646365be306a96206181d7c2833c7824e41d977788bcda4fa
|
|
7
|
+
data.tar.gz: 743aecd910ee3a6b66d8454cff8854d59f5ea287c579c852295c81ceee71b2fdb8716f3403aaf18281cc532a02fc336499617c6065a9a663f201215a16b530b9
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# isbot
|
|
2
2
|
|
|
3
|
-
####
|
|
4
|
-
|
|
3
|
+
#### Gem
|
|
5
4
|
|
|
5
|
+
https://rubygems.org/gems/isbot
|
|
6
6
|
|
|
7
7
|
#### Usage
|
|
8
8
|
|
|
@@ -23,4 +23,7 @@ puts user_agent.is_bot? # true
|
|
|
23
23
|
is_bot user_agent do |match_bot|
|
|
24
24
|
puts match_bot # Googlebot/
|
|
25
25
|
end
|
|
26
|
-
````
|
|
26
|
+
````
|
|
27
|
+
#### Attached:
|
|
28
|
+
|
|
29
|
+
The crawler user-agent data from https://github.com/monperrus/crawler-user-agents, thanks! 😀
|
data/bin/isbot
ADDED
data/{lib/fetch.sh → fetch.sh}
RENAMED
data/isbot.gemspec
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'isbot'
|
|
3
|
-
s.version = '0.1.
|
|
3
|
+
s.version = '0.1.1'
|
|
4
|
+
s.executables << 'isbot'
|
|
4
5
|
s.date = '2017-05-16'
|
|
5
6
|
s.summary = 'detects bots/crawlers/spiders via the user agent.'
|
|
6
|
-
s.description = 'A simple library for detecting bots/crawlers/spiders through
|
|
7
|
+
s.description = 'A simple library for detecting bots/crawlers/spiders through User-Agent strings.'
|
|
7
8
|
s.authors = ['Hentioe']
|
|
8
9
|
s.email = 'meow.i5.br@gmai.com'
|
|
9
10
|
s.files = Dir['**/*']
|
|
10
11
|
s.homepage =
|
|
11
12
|
'https://github.com/Hentioe/isbot'
|
|
12
|
-
s.license
|
|
13
|
+
s.license = 'MIT'
|
|
13
14
|
end
|
data/tests/isbot_test.rb
CHANGED
|
@@ -5,7 +5,7 @@ class IsBotTest < Test::Unit::TestCase
|
|
|
5
5
|
$list = [
|
|
6
6
|
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
|
|
7
7
|
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
|
|
8
|
-
'Mozilla/5.0 (compatible;
|
|
8
|
+
'Mozilla/5.0 (compatible; Baiduspid1er/2.0; +http://www.baidu.com/search/spider.html)'
|
|
9
9
|
]
|
|
10
10
|
|
|
11
11
|
def test_is_bot
|
|
@@ -15,7 +15,7 @@ class IsBotTest < Test::Unit::TestCase
|
|
|
15
15
|
def test_is_bot_with_block
|
|
16
16
|
$list.each do |ua|
|
|
17
17
|
is_bot ua do |match_bot|
|
|
18
|
-
puts match_bot
|
|
18
|
+
puts match_bot.to_s
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: isbot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hentioe
|
|
@@ -10,18 +10,20 @@ bindir: bin
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2017-05-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description: A simple library for detecting bots/crawlers/spiders through
|
|
13
|
+
description: A simple library for detecting bots/crawlers/spiders through User-Agent
|
|
14
14
|
strings.
|
|
15
15
|
email: meow.i5.br@gmai.com
|
|
16
|
-
executables:
|
|
16
|
+
executables:
|
|
17
|
+
- isbot
|
|
17
18
|
extensions: []
|
|
18
19
|
extra_rdoc_files: []
|
|
19
20
|
files:
|
|
20
21
|
- README.md
|
|
22
|
+
- bin/isbot
|
|
21
23
|
- data/data.json
|
|
24
|
+
- fetch.sh
|
|
22
25
|
- isbot.gemspec
|
|
23
26
|
- lib/Gemfile
|
|
24
|
-
- lib/fetch.sh
|
|
25
27
|
- lib/isbot.rb
|
|
26
28
|
- lib/parser.rb
|
|
27
29
|
- tests/isbot_test.rb
|