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.
@@ -0,0 +1,8 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - rbx-2.0
6
+ - jruby
7
+ - ruby-head
8
+ - ree
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # search\_terms
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/alindeman/search_terms.png)](http://travis-ci.org/alindeman/search_terms)
4
+
3
5
  **TL;DR**: **search\_terms** extracts search terms (keywords) from
4
6
  search engine referral URLs
5
7
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module SearchTerms
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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 AOL}
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
 
@@ -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: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
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 AOL
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