plagiarism2 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/plagiarism/cli.rb +1 -1
- data/lib/plagiarism/strategy.rb +1 -2
- data/lib/plagiarism/version.rb +1 -1
- metadata +3 -3
- data/lib/plagiarism/strategries/free_google.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 636e2299c2b5d463b4f9ea2fef28807ef96433c7
|
4
|
+
data.tar.gz: cf8bbbd31d55287f05bfd29e63489a794473ccc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38232af5aba8d2ca8b4c421877f4a89a041c52db58c9019bbf965aa9409ce1eb26e0f3d80b03dd406e8e57ad205abf78806354ea839dbe23797472ecbb16b806
|
7
|
+
data.tar.gz: 49c13d48a4efae6a34aaf036511fa44b65efef9525e571b011075addeaf93238581a3e77532bbc41288178c1ac16f4061adcbf0666101dc8aadb05707578a789
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Add in your config
|
|
23
23
|
```ruby
|
24
24
|
Plagiarism.configure do |config|
|
25
25
|
config.threshold = 0.8 # => default is 0.8
|
26
|
-
config.strategies = [xxx] # => [:google, :bing, :duck, :yahoo
|
26
|
+
config.strategies = [xxx] # => [:google, :bing, :duck, :yahoo]
|
27
27
|
config.whitelists = ['www.ring.md']
|
28
28
|
end
|
29
29
|
```
|
data/lib/plagiarism/cli.rb
CHANGED
@@ -21,7 +21,7 @@ module Plagiarism
|
|
21
21
|
method_option :path, aliases: '-p', desc: 'where put the config', type: :string, default: CONFIG_PATH
|
22
22
|
def init
|
23
23
|
create_file options[:path], <<-STRING
|
24
|
-
strategies: "
|
24
|
+
strategies: "yahoo"
|
25
25
|
whitelists: "www.ring.md, blog.ring.md"
|
26
26
|
bing_key: xxx
|
27
27
|
google_key: xxx
|
data/lib/plagiarism/strategy.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'plagiarism/strategries/engine'
|
2
2
|
require 'plagiarism/strategries/google'
|
3
|
-
require 'plagiarism/strategries/free_google'
|
4
3
|
require 'plagiarism/strategries/bing'
|
5
4
|
require 'plagiarism/strategries/duck'
|
6
5
|
require 'plagiarism/strategries/yahoo'
|
@@ -9,7 +8,7 @@ module Plagiarism
|
|
9
8
|
module Strategy
|
10
9
|
extend self
|
11
10
|
|
12
|
-
def get(name = :
|
11
|
+
def get(name = :yahoo)
|
13
12
|
Strategies.const_get(name.to_s.split('_').map(&:capitalize).join(''))
|
14
13
|
end
|
15
14
|
|
data/lib/plagiarism/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plagiarism2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MQuy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -146,7 +146,6 @@ files:
|
|
146
146
|
- lib/plagiarism/strategries/bing.rb
|
147
147
|
- lib/plagiarism/strategries/duck.rb
|
148
148
|
- lib/plagiarism/strategries/engine.rb
|
149
|
-
- lib/plagiarism/strategries/free_google.rb
|
150
149
|
- lib/plagiarism/strategries/google.rb
|
151
150
|
- lib/plagiarism/strategries/yahoo.rb
|
152
151
|
- lib/plagiarism/strategy.rb
|
@@ -177,3 +176,4 @@ signing_key:
|
|
177
176
|
specification_version: 4
|
178
177
|
summary: Check the unique content on internet.
|
179
178
|
test_files: []
|
179
|
+
has_rdoc:
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Plagiarism
|
2
|
-
module Strategies
|
3
|
-
class FreeGoogle < Engine
|
4
|
-
URL = 'https://ajax.googleapis.com/ajax/services/search/web'
|
5
|
-
VERSION = '1.0'
|
6
|
-
|
7
|
-
class << self
|
8
|
-
|
9
|
-
def fetch(content, params)
|
10
|
-
Typhoeus.get URL, params: params.merge(v: VERSION, q: content, rsz: :large)
|
11
|
-
end
|
12
|
-
|
13
|
-
def iterate(response, action = :all?)
|
14
|
-
results = JSON.parse(response)['responseData']['results'] rescue []
|
15
|
-
results.send(action) do |r|
|
16
|
-
uri = URI.parse URI::encode(r['unescapedUrl'])
|
17
|
-
yield uri
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|