twsh 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/myun2/twitter_shell/ls.rb +13 -6
- 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: 882457f4067329d734b42441ec8b72014a373062
|
4
|
+
data.tar.gz: 54f2bf772aa84bfb3c0cf58f26ef6753500a4024
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52fce3b9f48a518c884ed662574fd5f3159c87965f3390bc0f0a9f08e5f70af36338929287e5df615d691f03faede0df45d4ac3ef84d401fc00e0bd1b10e32b1
|
7
|
+
data.tar.gz: 5044bf1bf05305676fe67c1f8464be640dcfb3dcffcf092e284741a7a43c5155e6c00b7f52b2fad362a1ee9a936f3d13060f00acd7af5ad73b87e5a13376c048
|
@@ -7,19 +7,26 @@ module Myun2
|
|
7
7
|
|
8
8
|
def initialize(client, *params)
|
9
9
|
@client = client
|
10
|
-
format(home_timeline).each do |tweet| puts tweet end
|
10
|
+
format(home_timeline, *params).each do |tweet| puts tweet end
|
11
11
|
end
|
12
12
|
|
13
13
|
def home_timeline
|
14
14
|
client.home_timeline
|
15
15
|
end
|
16
16
|
|
17
|
-
def format(timeline)
|
17
|
+
def format(timeline, *params)
|
18
18
|
timeline.map do |t|
|
19
|
-
u = t[
|
20
|
-
user_name = u[
|
21
|
-
|
22
|
-
|
19
|
+
u = t['user']
|
20
|
+
user_name = u['name']
|
21
|
+
screen_name = u['screen_name']
|
22
|
+
text = t['text']
|
23
|
+
|
24
|
+
if params && params[0].include?('l')
|
25
|
+
datetime = t['created_at']
|
26
|
+
"#{datetime} <#{screen_name}:#{user_name}>: #{text}"
|
27
|
+
else
|
28
|
+
"<#{user_name}>: #{text[0..30]}"
|
29
|
+
end
|
23
30
|
end
|
24
31
|
end
|
25
32
|
end
|