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.
@@ -21,9 +21,33 @@ module Adsense
21
21
  nil
22
22
  end
23
23
 
24
- def today_so_far
24
+ def update_values!
25
25
  login!
26
- ( get('https://www.google.com/adsense/v3/m/home') / 'span[@class~=value]' ).first.inner_html
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
@@ -1,5 +1,5 @@
1
1
  module Adsense
2
2
  class Info
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 3
9
- version: 1.0.3
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-03-09 00:00:00 +02:00
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: -176140913
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: -176140913
115
+ hash: 3484807937997265488
116
116
  segments:
117
117
  - 0
118
118
  version: "0"