search_terms 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +8 -0
- data/README.md +2 -0
- data/lib/search_terms/extractor.rb +9 -1
- data/lib/search_terms/version.rb +1 -1
- data/search_terms.gemspec +1 -1
- data/spec/search_terms_spec.rb +21 -0
- metadata +5 -4
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -6,10 +6,12 @@ module SearchTerms
|
|
6
6
|
module Extractor
|
7
7
|
def search_string
|
8
8
|
case search_engine
|
9
|
-
when :google, :bing, :aol, :duckduckgo
|
9
|
+
when :google, :bing, :aol, :duckduckgo, :dogpile, :ask
|
10
10
|
query_parameters["q"].first
|
11
11
|
when :yahoo
|
12
12
|
query_parameters["p"].first
|
13
|
+
when :baidu
|
14
|
+
query_parameters["wd"].first
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
@@ -27,6 +29,12 @@ module SearchTerms
|
|
27
29
|
:aol
|
28
30
|
when /duckduckgo\./
|
29
31
|
:duckduckgo
|
32
|
+
when /dogpile\./
|
33
|
+
:dogpile
|
34
|
+
when /baidu\./
|
35
|
+
:baidu
|
36
|
+
when /ask\./
|
37
|
+
:ask
|
30
38
|
end
|
31
39
|
end
|
32
40
|
|
data/lib/search_terms/version.rb
CHANGED
data/search_terms.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = ["alindeman@gmail.com"]
|
10
10
|
s.homepage = "https://github.com/alindeman/search_terms"
|
11
11
|
s.summary = %q{Extracts search terms from search engine referral URLs}
|
12
|
-
s.description = %q{Supports extracting search terms from Google, Bing, Yahoo, DuckDuckGo, and
|
12
|
+
s.description = %q{Supports extracting search terms from Google, Bing, Yahoo, DuckDuckGo, AOL, Dogpile, and Baidu}
|
13
13
|
|
14
14
|
s.rubyforge_project = "search_terms"
|
15
15
|
|
data/spec/search_terms_spec.rb
CHANGED
@@ -52,4 +52,25 @@ describe SearchTerms::Extractor do
|
|
52
52
|
uri.search_string.should == "how to extract search terms"
|
53
53
|
end
|
54
54
|
end
|
55
|
+
|
56
|
+
context "dogpile" do
|
57
|
+
it "returns search terms from query string" do
|
58
|
+
uri = URI("http://dogpile.com/?q=how+to+extract+search+terms")
|
59
|
+
uri.search_string.should == "how to extract search terms"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "baidu" do
|
64
|
+
it "returns search terms from query string" do
|
65
|
+
uri = URI("http://www.baidu.com/s?wd=how+to+extract+search+terms")
|
66
|
+
uri.search_string.should == "how to extract search terms"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
context "ask" do
|
71
|
+
it "returns search terms from query string" do
|
72
|
+
uri = URI("http://www.ask.com/web?q=how+to+extract+search+terms")
|
73
|
+
uri.search_string.should == "how to extract search terms"
|
74
|
+
end
|
75
|
+
end
|
55
76
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: search_terms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Lindeman
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
type: :development
|
48
48
|
prerelease: false
|
49
49
|
name: rake
|
50
|
-
description: Supports extracting search terms from Google, Bing, Yahoo, DuckDuckGo, and
|
50
|
+
description: Supports extracting search terms from Google, Bing, Yahoo, DuckDuckGo, AOL, Dogpile, and Baidu
|
51
51
|
email:
|
52
52
|
- alindeman@gmail.com
|
53
53
|
executables: []
|
@@ -59,6 +59,7 @@ extra_rdoc_files: []
|
|
59
59
|
files:
|
60
60
|
- .gitignore
|
61
61
|
- .rspec
|
62
|
+
- .travis.yml
|
62
63
|
- Gemfile
|
63
64
|
- README.md
|
64
65
|
- Rakefile
|