mixi-community 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -46,6 +46,10 @@ See source for details.
46
46
 
47
47
  ## Changes
48
48
 
49
+ ### 0.0.3
50
+
51
+ * Support new date format
52
+
49
53
  ### 0.0.2
50
54
 
51
55
  * Add readme
@@ -56,7 +56,7 @@ module Mixi
56
56
  body_text = resolve_encoding(dd.at('dl.commentContent01 dd').text){|t|t.strip.gsub(/\n\n返信$/, '').gsub(/\r/,"\n")}
57
57
  comment_id = dt.at('.senderId a').attr(:name).gsub(/^comment_id_(\d+)$/, '\1')
58
58
  comment_num = dt.at('.senderId a').text.gsub(/^\[(\d+)\]$/, '\1')
59
- time = resolve_encoding(dt.at('.date').text){|t| Time.strptime(t, '%Y年%m月%d日 %H:%M') }
59
+ time = resolve_encoding(dt.at('.date').text) {|t| parse_comment_time(t) }
60
60
 
61
61
  Comment.new(
62
62
  comment_id,
@@ -87,6 +87,16 @@ module Mixi
87
87
  end
88
88
  end
89
89
 
90
+ def parse_comment_time(time_str)
91
+ format = '%m月%d日 %H:%M'
92
+ time_str = time_str.strip
93
+ begin
94
+ Time.strptime(time_str, format)
95
+ rescue ArgumentError
96
+ raise ArgumentError, "Time format not matched: format=#{format}, input=#{time_str}"
97
+ end
98
+ end
99
+
90
100
  class Comment
91
101
  def initialize(id, params)
92
102
  @id = id
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "mixi-community"
3
- gem.version = "0.0.2"
3
+ gem.version = "0.0.3"
4
4
  gem.authors = ["todesking"]
5
5
  gem.email = ["discommunicative@gmail.com"]
6
6
  gem.summary = %q{Access to Mixi community.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixi-community
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-27 00:00:00.000000000 Z
12
+ date: 2013-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
@@ -60,8 +60,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 1.8.24
63
+ rubygems_version: 1.8.19
64
64
  signing_key:
65
65
  specification_version: 3
66
66
  summary: Access to Mixi community.
67
67
  test_files: []
68
+ has_rdoc: