twsh 0.4.3 → 0.4.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.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/myun2/twitter_shell/ls.rb +19 -10
- data/lib/myun2/twitter_shell/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa64b3f8a82910c23caed89b682655797b5a0fc6
|
4
|
+
data.tar.gz: 0b33a2346c6b616f08f18f83f0062a3200de04c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 891d28a954811f1e1009cff3075056efeca6cdf9a2e0c8aaef32d72277c1201ebded0eab2963041455dea8bcaeb953b841fa0c71801daee433ad931e7647c998
|
7
|
+
data.tar.gz: da65d50fd1cbbb00a40d85b8444266c0c8f21e3b78f1f7e2a4d0dc99550ed416836f8668bad41e0a76aac18fa3d9c3b730746a723c027412b38c54cebc5165ae
|
data/README.md
CHANGED
@@ -34,6 +34,7 @@ $ ls -l
|
|
34
34
|
# Show your home-timeline (shown 30 charactors tweet text, and only 20 tweets count.)
|
35
35
|
# Option 'mention': mention timeline
|
36
36
|
# Option '-l': detail timeline (timestamp and user id, full tweet text)
|
37
|
+
# Option '-c=<count>': tweet count specify
|
37
38
|
|
38
39
|
$ tail
|
39
40
|
# Realtime show your home-timeline
|
@@ -11,30 +11,30 @@ module Myun2
|
|
11
11
|
if params && params.length > 0
|
12
12
|
case
|
13
13
|
when params[0] == '-m' || params[0] == 'mention' || params[0] == 'mentions'
|
14
|
-
timeline = mentions_timeline
|
15
14
|
params.shift
|
15
|
+
timeline = mentions_timeline(*params)
|
16
16
|
when params[0][0] != '-'
|
17
|
-
|
18
|
-
params
|
17
|
+
user_name = params.shift
|
18
|
+
timeline = user_timeline(user_name, *params)
|
19
19
|
end
|
20
20
|
end
|
21
|
-
timeline ||= home_timeline
|
21
|
+
timeline ||= home_timeline(*params)
|
22
22
|
|
23
23
|
timeline.each do |t|
|
24
24
|
puts format(t, *params)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
def user_timeline(screen_name)
|
29
|
-
client.user_timeline(screen_name: screen_name)
|
28
|
+
def user_timeline(screen_name, *params)
|
29
|
+
client.user_timeline({ screen_name: screen_name }.merge(params_to_options *params))
|
30
30
|
end
|
31
31
|
|
32
|
-
def mentions_timeline
|
33
|
-
client.mentions
|
32
|
+
def mentions_timeline(*params)
|
33
|
+
client.mentions(params_to_options *params)
|
34
34
|
end
|
35
35
|
|
36
|
-
def home_timeline
|
37
|
-
client.home_timeline
|
36
|
+
def home_timeline(*params)
|
37
|
+
client.home_timeline(params_to_options *params)
|
38
38
|
end
|
39
39
|
|
40
40
|
def format(tweet, *params)
|
@@ -50,6 +50,15 @@ module Myun2
|
|
50
50
|
"<#{user_name}>: #{text[0..30]}"
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
private
|
55
|
+
def params_to_options(*params)
|
56
|
+
options = {}
|
57
|
+
params.each do |param|
|
58
|
+
options[:count] = $1.to_i if /\A-c=(\d+)\Z/ =~ param
|
59
|
+
end
|
60
|
+
options
|
61
|
+
end
|
53
62
|
end
|
54
63
|
end
|
55
64
|
end
|