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 +4 -0
- data/lib/mixi-community.rb +11 -1
- data/mixi-community.gemspec +1 -1
- metadata +4 -3
data/README.md
CHANGED
data/lib/mixi-community.rb
CHANGED
@@ -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|
|
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
|
data/mixi-community.gemspec
CHANGED
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.
|
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-
|
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.
|
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:
|