Module: SeoParams

Defined in:
lib/seo_params.rb,
lib/seo_params/bing.rb,
lib/seo_params/alexa.rb,
lib/seo_params/yahoo.rb,
lib/seo_params/google.rb,
lib/seo_params/yandex.rb,
lib/seo_params/twitter.rb,
lib/seo_params/version.rb,
lib/seo_params/facebook.rb,
lib/seo_params/netcraft.rb,
lib/seo_params/google_plus.rb

Defined Under Namespace

Classes: Alexa, Bing, Facebook, Google, GooglePlus, Netcraft, Twitter, Yahoo, Yandex

Constant Summary collapse

VERSION =
"0.0.7"

Class Method Summary collapse

Class Method Details

.all(url) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/seo_params.rb', line 17

def all(url)
  h = Hash.new
  h["pr"] = pr(url)
  h["gp"] = gp(url)
  h["tic"] = tic(url)
  h["yap"] = yap(url)
  h["tweets"] = tweets(url)
  h["likes"] = likes(url)
  h["ar"] = ar(url)
  h["dmoz"] = dmoz(url)
  h["plus_ones"] = plus_ones(url)
  h["yahoo"] = yahoo(url)
  h["bing"] = bing(url)
  h
end

.ar(url) ⇒ Object



76
77
78
# File 'lib/seo_params.rb', line 76

def ar(url)
  Alexa.new(url).rank
end

.bing(url) ⇒ Object



96
97
98
# File 'lib/seo_params.rb', line 96

def bing(url)
  Bing.new(url).bing_pages
end

.dmoz(url) ⇒ Object



80
81
82
# File 'lib/seo_params.rb', line 80

def dmoz(url)
  Alexa.new(url).dmoz
end

.gp(url) ⇒ Object



45
46
47
# File 'lib/seo_params.rb', line 45

def gp(url)
  Google.new(url).google_pages
end

.gposition(url, keywords, options = {}) ⇒ Object



58
59
60
61
62
63
64
65
66
# File 'lib/seo_params.rb', line 58

def gposition(url, keywords, options = {})
  options[:hl]  ||= "ru"
  options[:cr]  ||= "countryUA"
  options[:num] ||= 100

  (keywords.is_a? Array) ? keywords : keywords = Array.new.push(keywords)

  Google.new(url).google_position(options[:hl], options[:cr], keywords, options[:num])
end

.likes(url) ⇒ Object



72
73
74
# File 'lib/seo_params.rb', line 72

def likes(url)
  Facebook.new(url).likes
end

.netcraft(url) ⇒ Object



84
85
86
# File 'lib/seo_params.rb', line 84

def netcraft(url)
  Netcraft.new(url).all
end

.plus_ones(url) ⇒ Object



88
89
90
# File 'lib/seo_params.rb', line 88

def plus_ones(url)
  GooglePlus.new(url).plus_ones
end

.pr(url) ⇒ Object



33
34
35
# File 'lib/seo_params.rb', line 33

def pr(url)
  Google.new(url).pagerank
end

.tic(url) ⇒ Object



37
38
39
# File 'lib/seo_params.rb', line 37

def tic(url)
  Yandex.new(url).tic
end

.tweets(url) ⇒ Object



68
69
70
# File 'lib/seo_params.rb', line 68

def tweets(url)
  Twitter.new(url).tweets
end

.yahoo(url) ⇒ Object



92
93
94
# File 'lib/seo_params.rb', line 92

def yahoo(url)
  Yahoo.new(url).yahoo_pages
end

.yap(url) ⇒ Object



41
42
43
# File 'lib/seo_params.rb', line 41

def yap(url)
  Yandex.new(url).yandex_pages
end

.yaposition(url, user, key, keywords, options = {}) ⇒ Object



49
50
51
52
53
54
55
56
# File 'lib/seo_params.rb', line 49

def yaposition(url, user, key, keywords, options = {})
  options[:lr]  ||= 187
  options[:num] ||= 100

  (keywords.is_a? Array) ? keywords : keywords = Array.new.push(keywords)

  Yandex.new(url).yandex_position(user, key, options[:lr], keywords, options[:num])
end