keyword_ranking 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/keyword_ranking.gemspec +2 -2
- data/lib/keyword_ranking.rb +2 -1
- metadata +3 -3
- data/Gemfile.lock +0 -28
data/README
CHANGED
@@ -2,7 +2,7 @@ Keyword Ranking
|
|
2
2
|
|
3
3
|
Use this gem to calculate the keyword ranking in Bing, Yahoo or Google as follows:
|
4
4
|
|
5
|
-
|
5
|
+
KeywordRanking::Ranking.instance.get(:keyword => 'one_keyword', :url => 'www.mydomain.com', :engine => :bing, :limit => 100)
|
6
6
|
|
7
7
|
Note:
|
8
8
|
|
data/keyword_ranking.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{keyword_ranking}
|
5
|
-
s.version = "1.0"
|
5
|
+
s.version = "1.0.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Luis Alberto Velasco"]
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = %q{Create keyword rankings from the 3 major browsers}
|
11
11
|
s.email = %q{whizkas@hotmail.com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "lib/keyword_ranking.rb"]
|
13
|
-
s.files = ["CHANGELOG", "Gemfile", "
|
13
|
+
s.files = ["CHANGELOG", "Gemfile", "LICENSE", "README", "Rakefile", "lib/keyword_ranking.rb", "spec/keyword_ranking_spec.rb", "spec/spec.opts", "keyword_ranking.gemspec"]
|
14
14
|
s.homepage = %q{http://github.com/whizkas/keyword_ranking}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Keyword_ranking", "--main", "README"]
|
16
16
|
s.require_paths = ["lib"]
|
data/lib/keyword_ranking.rb
CHANGED
@@ -32,6 +32,7 @@ module KeywordRanking
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def find_ranking(keyword, site, limit, engine)
|
35
|
+
keyword.gsub!(/\s/, '+')
|
35
36
|
request_url, results_container, cite_container = case engine.to_sym
|
36
37
|
when :bing
|
37
38
|
["http://www.bing.com/search?q=#{keyword}&count=#{RES_PER_PAGE}&first=", '#wg0 > li', 'cite']
|
@@ -46,7 +47,7 @@ module KeywordRanking
|
|
46
47
|
rank = results.index(results.detect{ |result| result.css(cite_container).text.match Regexp.new(site) })
|
47
48
|
if count > RES_LIMIT
|
48
49
|
break
|
49
|
-
|
50
|
+
elsif rank
|
50
51
|
rank = count + rank
|
51
52
|
break
|
52
53
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keyword_ranking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Luis Alberto Velasco
|
@@ -64,7 +65,6 @@ extra_rdoc_files:
|
|
64
65
|
files:
|
65
66
|
- CHANGELOG
|
66
67
|
- Gemfile
|
67
|
-
- Gemfile.lock
|
68
68
|
- LICENSE
|
69
69
|
- README
|
70
70
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
keyword_ranking (1.0)
|
5
|
-
nokogiri
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
echoe (4.3.1)
|
11
|
-
gemcutter
|
12
|
-
rubyforge
|
13
|
-
gemcutter (0.6.1)
|
14
|
-
json_pure (1.4.6)
|
15
|
-
nokogiri (1.4.3.1)
|
16
|
-
rspec (1.3.0)
|
17
|
-
rubyforge (2.0.4)
|
18
|
-
json_pure (>= 1.1.7)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
bundler
|
25
|
-
echoe
|
26
|
-
keyword_ranking!
|
27
|
-
nokogiri
|
28
|
-
rspec
|