adsense-info 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/adsense-info.rb +26 -2
- data/lib/adsense-info/version.rb +1 -1
- metadata +5 -5
data/lib/adsense-info.rb
CHANGED
@@ -21,9 +21,33 @@ module Adsense
|
|
21
21
|
nil
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def update_values!
|
25
25
|
login!
|
26
|
-
( get('https://www.google.com/adsense/v3/m/home') / 'span[@class~=value]' )
|
26
|
+
values = ( get('https://www.google.com/adsense/v3/m/home') / 'span[@class~=value]' )
|
27
|
+
@today_so_far = values[0].inner_html
|
28
|
+
@yesterday = values[1].inner_html
|
29
|
+
@this_month_so_far = values[2].inner_html
|
30
|
+
@last_month = values[3].inner_html
|
31
|
+
end
|
32
|
+
|
33
|
+
def today_so_far
|
34
|
+
update_values! unless @today_so_far
|
35
|
+
@today_so_far
|
36
|
+
end
|
37
|
+
|
38
|
+
def yesterday
|
39
|
+
update_values! unless @yesterday
|
40
|
+
@yesterday
|
41
|
+
end
|
42
|
+
|
43
|
+
def this_month_so_far
|
44
|
+
update_values! unless @this_month_so_far
|
45
|
+
@this_month_so_far
|
46
|
+
end
|
47
|
+
|
48
|
+
def last_month
|
49
|
+
update_values! unless @last_month
|
50
|
+
@last_month
|
27
51
|
end
|
28
52
|
|
29
53
|
private
|
data/lib/adsense-info/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 4
|
9
|
+
version: 1.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Clive Crous
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-04-06 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
requirements:
|
104
104
|
- - ">="
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
hash:
|
106
|
+
hash: 3484807937997265488
|
107
107
|
segments:
|
108
108
|
- 0
|
109
109
|
version: "0"
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
requirements:
|
113
113
|
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
hash:
|
115
|
+
hash: 3484807937997265488
|
116
116
|
segments:
|
117
117
|
- 0
|
118
118
|
version: "0"
|