timelog4r 0.1.0 → 0.1.1
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/History.txt +7 -0
- data/License.txt +2 -2
- data/README.txt +1 -1
- data/example/create_refollow_list.rb +2 -1
- data/example/hello_world.rb +1 -0
- data/lib/timelog4r/version.rb +1 -1
- data/lib/timelog4r/xml_parser.rb +3 -0
- data/lib/timelog4r.rb +74 -7
- data/spec/timelog4r_spec.rb +38 -0
- data/website/index.html +12 -6
- data/website/index.txt +8 -6
- metadata +6 -4
data/History.txt
CHANGED
data/License.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2008
|
1
|
+
Copyright (c) 2008 saronpasu
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.txt
CHANGED
@@ -21,7 +21,7 @@ sudo gem install timelog4r
|
|
21
21
|
|
22
22
|
(The MIT License)
|
23
23
|
|
24
|
-
Copyright (c) 2008
|
24
|
+
Copyright (c) 2008 saronpasu
|
25
25
|
|
26
26
|
Permission is hereby granted, free of charge, to any person obtaining
|
27
27
|
a copy of this software and associated documentation files (the
|
@@ -6,7 +6,8 @@ t = Timelog4r.new
|
|
6
6
|
t.user_id = 'your Timelog ID'
|
7
7
|
t.password = 'your Password'
|
8
8
|
|
9
|
-
friends = t.
|
9
|
+
friends = t.get_memofriend_list({:cnt => 'all'}
|
10
|
+
sleep 10
|
10
11
|
fan = t.get_fan_list({:cnt => 'all'})
|
11
12
|
|
12
13
|
not_yet_followings = fan[:entries].map{|i|i[:id]} - friends[:entries].map{|j|j[:id]}
|
data/example/hello_world.rb
CHANGED
data/lib/timelog4r/version.rb
CHANGED
data/lib/timelog4r/xml_parser.rb
CHANGED
data/lib/timelog4r.rb
CHANGED
@@ -43,7 +43,8 @@ Params::
|
|
43
43
|
|
44
44
|
:cnt => entry_count [Fixnum],
|
45
45
|
:stat => entry_type(:bm|:gn) [String],
|
46
|
-
:since => entry_after_since [Time]
|
46
|
+
:since => entry_after_since [Time],
|
47
|
+
:hc => favorites disp-flag(0|1) [Fixnum]
|
47
48
|
|
48
49
|
} [Hash] default nil
|
49
50
|
|
@@ -76,7 +77,8 @@ Params::
|
|
76
77
|
options {
|
77
78
|
|
78
79
|
:cnt => entry_count [Fixnum],
|
79
|
-
:since => entry_after_since [Time]
|
80
|
+
:since => entry_after_since [Time],
|
81
|
+
:hc => favorites disp-flag(0|1) [Fixnum]
|
80
82
|
|
81
83
|
} [Hash] default nil
|
82
84
|
|
@@ -111,7 +113,8 @@ Params::
|
|
111
113
|
:cnt => entry_count [Fixnum],
|
112
114
|
:stat => entry_tipe [String],
|
113
115
|
:since => entry_after_since [Time],
|
114
|
-
:tag => find_entries_from_tag [String]
|
116
|
+
:tag => find_entries_from_tag [String],
|
117
|
+
:hc => favorites disp-flag(0|1) [Fixnum]
|
115
118
|
|
116
119
|
} [Hash] default nil
|
117
120
|
|
@@ -136,6 +139,38 @@ RelatedMethods::
|
|
136
139
|
return result
|
137
140
|
end
|
138
141
|
|
142
|
+
=begin rdoc
|
143
|
+
Description::
|
144
|
+
get my memo-clips[http://timelog.jp/profile/clip.asp]
|
145
|
+
|
146
|
+
Params::
|
147
|
+
options = {
|
148
|
+
|
149
|
+
:cnt => entry_count [Fixnum],
|
150
|
+
:hc => favorites disp-flag(0|1) [Fixnum]
|
151
|
+
|
152
|
+
} [Hash] default nil
|
153
|
+
|
154
|
+
Return::
|
155
|
+
{:title => 'Timelog ... ', :entries => {...} }
|
156
|
+
|
157
|
+
RelatedMethods::
|
158
|
+
Utils#parse_options
|
159
|
+
Utils#create_uri
|
160
|
+
Utils#create_request
|
161
|
+
Utils#http_access
|
162
|
+
XML_Parser#parse_timeline
|
163
|
+
=end
|
164
|
+
def get_memo_clip(options = nil)
|
165
|
+
address = BaseAddress + 'clip_msg.asp'
|
166
|
+
address += parse_options(options) if options
|
167
|
+
uri = create_uri(address)
|
168
|
+
request = create_request(:get, uri, true)
|
169
|
+
response = http_access(uri, request)
|
170
|
+
result = parse_timeline(response) if response
|
171
|
+
return result
|
172
|
+
end
|
173
|
+
|
139
174
|
=begin rdoc
|
140
175
|
Description::
|
141
176
|
get my profile[http://user_id.timelog.jp]
|
@@ -166,7 +201,8 @@ Description::
|
|
166
201
|
|
167
202
|
Params::
|
168
203
|
options {
|
169
|
-
:cnt => friend_count [
|
204
|
+
:cnt => friend_count(1-50 or all) [String],
|
205
|
+
:ac => target_user [String]
|
170
206
|
} [Hash] default nil
|
171
207
|
|
172
208
|
Return::
|
@@ -196,7 +232,8 @@ Description::
|
|
196
232
|
|
197
233
|
Params::
|
198
234
|
options {
|
199
|
-
:cnt => user_count [
|
235
|
+
:cnt => user_count(1-50 or all) [String],
|
236
|
+
:ac => target_user [String]
|
200
237
|
} [Hash] default nil
|
201
238
|
|
202
239
|
Return::
|
@@ -220,13 +257,42 @@ RelatedMethods::
|
|
220
257
|
return result
|
221
258
|
end
|
222
259
|
|
260
|
+
=begin rdoc
|
261
|
+
Description::
|
262
|
+
get memofriend_list[http://timelog.jp/frito.asp?ac=user_id]
|
263
|
+
|
264
|
+
Params::
|
265
|
+
options = {
|
266
|
+
|
267
|
+
:cnt => entry_count(1-50 or all)[String],
|
268
|
+
:ac => target_user[String]
|
269
|
+
|
270
|
+
} [Hash] default nil
|
271
|
+
|
272
|
+
Return::
|
273
|
+
{:title => 'Timelog ...', :entries => [...]}
|
274
|
+
|
275
|
+
RelatedMethods::
|
276
|
+
|
277
|
+
=end
|
278
|
+
def get_memofriend_list(options = nil)
|
279
|
+
address = BaseAddress + 'memofriends.asp'
|
280
|
+
address += parse_options(options) if options
|
281
|
+
uri = create_uri(address)
|
282
|
+
request = create_request(:get, uri, true)
|
283
|
+
response = http_access(uri, request)
|
284
|
+
result = parse_user_list(response) if response
|
285
|
+
return result
|
286
|
+
end
|
287
|
+
|
223
288
|
=begin rdoc
|
224
289
|
Description::
|
225
290
|
get tag list[http://timelog.jp/taglist.asp]
|
226
291
|
|
227
292
|
Params::
|
228
293
|
options {
|
229
|
-
:cnt => tag_count [Fixnum]
|
294
|
+
:cnt => tag_count [Fixnum],
|
295
|
+
:stat => sort from tag_count(asc|desc) [String]
|
230
296
|
} [Hash] default nil
|
231
297
|
|
232
298
|
Return::
|
@@ -286,7 +352,8 @@ Description::
|
|
286
352
|
|
287
353
|
Params::
|
288
354
|
options {
|
289
|
-
:cnt => entry_count [Fixnum]
|
355
|
+
:cnt => entry_count [Fixnum],
|
356
|
+
:hc => favorites disp-flag(0|1) [Fixnum]
|
290
357
|
} [Hash] default nil
|
291
358
|
|
292
359
|
Return::
|
data/spec/timelog4r_spec.rb
CHANGED
@@ -54,6 +54,7 @@ describe Timelog4r, ' when first created' do
|
|
54
54
|
<fromid>b</fromid>
|
55
55
|
<fromname>b</fromname>' +
|
56
56
|
@dummy_author_b +
|
57
|
+
'<star>2</star>' +
|
57
58
|
'</entry>'
|
58
59
|
@dummy_entry_c = '
|
59
60
|
<entry>
|
@@ -68,6 +69,7 @@ describe Timelog4r, ' when first created' do
|
|
68
69
|
<link href="http://a.com" />
|
69
70
|
<modified>200201220122</modified>' +
|
70
71
|
@dummy_author_a +
|
72
|
+
'<star>0</star>' +
|
71
73
|
'</entry>'
|
72
74
|
@dummy_timeline = '
|
73
75
|
<memos>
|
@@ -215,6 +217,24 @@ describe Timelog4r, ' when first created' do
|
|
215
217
|
end
|
216
218
|
end
|
217
219
|
|
220
|
+
describe ' when get memo clip' do
|
221
|
+
before do
|
222
|
+
doc = REXML::Document.new(@dummy_timeline)
|
223
|
+
@accessor.user_id = 'dummy'
|
224
|
+
@accessor.password = 'dummy'
|
225
|
+
@accessor.should_receive(:http_access).once.and_return(doc)
|
226
|
+
end
|
227
|
+
|
228
|
+
it 'successful should be a kind of Hash' do
|
229
|
+
@accessor.get_memo_clip.should be_a_kind_of(Hash)
|
230
|
+
end
|
231
|
+
|
232
|
+
after do
|
233
|
+
@accessor.user_id = nil
|
234
|
+
@accessor.password = nil
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
218
238
|
describe ' when get tag list' do
|
219
239
|
before do
|
220
240
|
doc = REXML::Document.new(@dummy_tag_list)
|
@@ -287,6 +307,24 @@ describe Timelog4r, ' when first created' do
|
|
287
307
|
end
|
288
308
|
end
|
289
309
|
|
310
|
+
describe ' when get memofriend list' do
|
311
|
+
before do
|
312
|
+
doc = REXML::Document.new(@dummy_user_list)
|
313
|
+
@accessor.user_id = 'dummy'
|
314
|
+
@accessor.password = 'dummy'
|
315
|
+
@accessor.should_receive(:http_access).once.and_return(doc)
|
316
|
+
end
|
317
|
+
|
318
|
+
it 'success should be a kind of Hash' do
|
319
|
+
@accessor.get_memofriend_list.should be_a_kind_of(Hash)
|
320
|
+
end
|
321
|
+
|
322
|
+
after do
|
323
|
+
@accessor.user_id = nil
|
324
|
+
@accessor.password = nil
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
290
328
|
describe ' when update' do
|
291
329
|
before do
|
292
330
|
@accessor.user_id = 'dummy'
|
data/website/index.html
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
7
|
<title>
|
8
|
-
|
8
|
+
Timelog4r
|
9
9
|
</title>
|
10
10
|
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
11
|
<style>
|
@@ -30,16 +30,22 @@
|
|
30
30
|
<body>
|
31
31
|
<div id="main">
|
32
32
|
|
33
|
-
<h1>
|
33
|
+
<h1>Timelog4r</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/timelog4r"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/timelog4r" class="numbers">0.
|
36
|
+
<a href="http://rubyforge.org/projects/timelog4r" class="numbers">0.1.1</a>
|
37
37
|
</div>
|
38
|
-
<
|
39
|
-
<
|
38
|
+
<h2>What</h2>
|
39
|
+
<p>Timelog4r is TimelogAPI for ruby.</p>
|
40
40
|
<h2>Installing</h2>
|
41
41
|
<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">timelog4r</span></pre></p>
|
42
42
|
<h2>The basics</h2>
|
43
|
+
<p>require ‘timelog4r’<br />
|
44
|
+
t = Timelog4r.new<br />
|
45
|
+
t.user_id = ‘your user_id’<br />
|
46
|
+
t.password = ‘your password’<br />
|
47
|
+
t.user_agent = ‘your appli name’ #=> optional setting.<br />
|
48
|
+
t.update ‘Hello, Timelog.(from ruby)’ #=> send to TimelogAPI.</p>
|
43
49
|
<h2>Demonstration of usage</h2>
|
44
50
|
<p><span class="caps">TODO</span> – pick <span class="caps">SVN</span> or Git instructions</p>
|
45
51
|
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/timelog4r/trunk</code> for anonymous access.</p>
|
@@ -61,7 +67,7 @@ rake install_gem</pre>
|
|
61
67
|
<h2>Contact</h2>
|
62
68
|
<p>Comments are welcome. Send an email to <a href="mailto:jamneco">saronpasu</a> at gmail dot com mail</p>
|
63
69
|
<p class="coda">
|
64
|
-
<a href="FIXME email">FIXME full name</a>,
|
70
|
+
<a href="FIXME email">FIXME full name</a>, 25th May 2009<br>
|
65
71
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
66
72
|
</p>
|
67
73
|
</div>
|
data/website/index.txt
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
h1.
|
2
|
-
|
3
|
-
h1. → 'timelog4r'
|
4
|
-
|
1
|
+
h1. Timelog4r
|
5
2
|
|
6
3
|
h2. What
|
7
4
|
|
5
|
+
Timelog4r is TimelogAPI for ruby.
|
8
6
|
|
9
7
|
h2. Installing
|
10
8
|
|
@@ -12,15 +10,19 @@ h2. Installing
|
|
12
10
|
|
13
11
|
h2. The basics
|
14
12
|
|
13
|
+
require 'timelog4r'
|
14
|
+
t = Timelog4r.new
|
15
|
+
t.user_id = 'your user_id'
|
16
|
+
t.password = 'your password'
|
17
|
+
t.user_agent = 'your appli name' #=> optional setting.
|
18
|
+
t.update 'Hello, Timelog.(from ruby)' #=> send to TimelogAPI.
|
15
19
|
|
16
20
|
h2. Demonstration of usage
|
17
21
|
|
18
22
|
|
19
|
-
TODO - pick SVN or Git instructions
|
20
23
|
|
21
24
|
The trunk repository is <code>svn://rubyforge.org/var/svn/timelog4r/trunk</code> for anonymous access.
|
22
25
|
|
23
|
-
OOOORRRR
|
24
26
|
|
25
27
|
You can fetch the source from either:
|
26
28
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timelog4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saronpasu
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-25 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -68,6 +68,8 @@ files:
|
|
68
68
|
- website/template.html.erb
|
69
69
|
has_rdoc: true
|
70
70
|
homepage: http://timelog4r.rubyforge.org
|
71
|
+
licenses: []
|
72
|
+
|
71
73
|
post_install_message: ""
|
72
74
|
rdoc_options:
|
73
75
|
- --main
|
@@ -89,9 +91,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
91
|
requirements: []
|
90
92
|
|
91
93
|
rubyforge_project: timelog4r
|
92
|
-
rubygems_version: 1.
|
94
|
+
rubygems_version: 1.3.3
|
93
95
|
signing_key:
|
94
|
-
specification_version:
|
96
|
+
specification_version: 3
|
95
97
|
summary: TimelogAPI for ruby.
|
96
98
|
test_files: []
|
97
99
|
|