ruboty-amazon_wishlist 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03f6f92e4cec435f7ece89c8a6684614a862528e
4
- data.tar.gz: a02f40de9cf51f063fce6292e9bda815d18edb24
3
+ metadata.gz: c81149b1729803b49f4f41fc3225e761783f7c89
4
+ data.tar.gz: 93b15bfdf859c8cc3dad990e269dcf0c1e5a323a
5
5
  SHA512:
6
- metadata.gz: d1d8d55a4f116c224efbafdd77a1281973d9025941cda27f779d299b06f3c5bf17f01a339cc6ce8dcb806823c05f1874c4b904840c7a88249a55d9bcd35bfd99
7
- data.tar.gz: 7eaa5c85500d29ebfbdd6065ce6a27e8846ef5aeb32d8851ce272c9dbed580a4101adeed83d88e36ab83e6452cc8fe0ad2873481766553703dec5f7ef93430b0
6
+ metadata.gz: c7acce1053efc3cf562a03e720fea7fd0e012e90ee6b537f7bf36756d76a29c94434a9b7f3aa80b28c6e2667df360344508b253e76666bda89057689023d1ffd
7
+ data.tar.gz: 78b0838c952110d351adb30046de4eff9dcfd4a46066711ff7baea93707b7650effadcd384d0bd2d6b1cf26f87bef73d793ed75b340553a0e507f9dac875fdca
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Ruboty::Amazon_wishlist
2
2
 
3
- Ruboty handler to check whether the prices of items in your Amazon wishlist
4
- has changed. http://www.amazon.co.jp/
3
+ Ruboty handler to monitor the prices of items in your Amazon wishlist.
4
+ http://www.amazon.co.jp/
5
5
 
6
6
  ## Installation
7
7
 
8
8
  ```ruby
9
- gem 'ruboty-amazon_wishlist' :github => 'haccht/ruboty-amazon_wishlist'
9
+ gem 'ruboty-amazon_wishlist'
10
10
  ```
11
11
 
12
12
  ## Usage
@@ -18,9 +18,9 @@ gem 'ruboty-amazon_wishlist' :github => 'haccht/ruboty-amazon_wishlist'
18
18
 
19
19
  ## Env
20
20
 
21
- Requires the Amazon wishlist ID from your wishlist url.
22
- http://www.amazon.co.jp/gp/registry/wishlist/*************/
21
+ Requires the Amazon wishlist ID in your wishlist URL.
22
+ http://www.amazon.co.jp/gp/registry/wishlist/##########/
23
23
 
24
24
  ```
25
- export AMAZON_WISHLIST_ID=*************
25
+ export AMAZON_WISHLIST_ID=##########
26
26
  ```
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Amazon_wishlist
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
@@ -35,12 +35,14 @@ module Ruboty
35
35
  items.each { |item| text.puts item }
36
36
  message.reply(text.string)
37
37
  end
38
+ rescue
39
+ log(:error, 'Error fetching wishlist items')
38
40
  end
39
41
 
40
42
  def list_updated(message)
41
43
  items = []
42
44
  list_items.each do |id, item|
43
- item[:price] = 'null' if item[:price].empty?
45
+ item[:price] = 'null' unless item[:price] =~ /¥\d+/
44
46
  last_price = cache[id].to_s.force_encoding('utf-8')
45
47
  if item[:price] != last_price
46
48
  items << "#{item[:title]} (from:#{last_price} to:#{item[:price]})"
@@ -60,6 +62,8 @@ module Ruboty
60
62
  items.each { |item| text.puts item }
61
63
  message.reply(text.string)
62
64
  end
65
+ rescue
66
+ log(:error, 'Error fetching wishlist items')
63
67
  end
64
68
 
65
69
  def list_items
@@ -93,6 +97,10 @@ module Ruboty
93
97
  def cache
94
98
  robot.brain.data[Ruboty::Amazon_wishlist::NAMESPACE] ||= {}
95
99
  end
100
+
101
+ def log(level, message)
102
+ Ruboty.logger.send(level, "[#{Time.now}] ruboty-amazon_wishlist: #{message}")
103
+ end
96
104
  end
97
105
  end
98
106
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-amazon_wishlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - haccht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-27 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.4.8
106
+ rubygems_version: 2.4.5
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Ruboty handler to check whether the prices of items in your Amazon wishlist