tw 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/lib/tw/app/cmds.rb +0 -1
- data/lib/tw/app/render.rb +3 -1
- data/lib/tw/client/request.rb +15 -6
- data/lib/tw/client/tweet.rb +6 -2
- data/lib/tw/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: d187427630eeb401fbbbf16c9520d3c0e470e333
|
4
|
+
data.tar.gz: 496eec941e377850d175d49fa248f10194a82f67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 931dd7711379a66bca7809915c21afaae1f71a6a9f522e0ed54e0eefa5b640bf9ee73a7ba18b3cd949368475f21086d75ccb449e37ce8092eead7077a798539d
|
7
|
+
data.tar.gz: f5040f148bba10725dc0b4a7ec7cd8886f46a3c5c595efe5668981fe39daaf7591c93b139265fcd16ff06f234c093f911e570a6d87ddf74080895aedd65d5c4b
|
data/History.txt
CHANGED
data/lib/tw/app/cmds.rb
CHANGED
data/lib/tw/app/render.rb
CHANGED
@@ -38,8 +38,10 @@ module Tw::App
|
|
38
38
|
when 'text'
|
39
39
|
user = m.user.kind_of?(Hash) ? "@#{m.user[:from]} > @#{m.user[:to]}" : "@#{m.user}"
|
40
40
|
line = "#{m.time.strftime '[%m/%d %a] (%H:%M:%S)'} #{user} : #{CGI.unescapeHTML m.text}"
|
41
|
+
line += " #{m.fav_count}Fav" if m.fav_count.to_i > 0
|
42
|
+
line += " #{m.rt_count}RT" if m.rt_count.to_i > 0
|
41
43
|
line += " <#{m.id}>" if show_status_id
|
42
|
-
line.colorize(/@[a-zA-Z0-9_]
|
44
|
+
line.colorize(/@[a-zA-Z0-9_]+|\d+RT|\d+Fav/)
|
43
45
|
when 'json'
|
44
46
|
m.to_json
|
45
47
|
else
|
data/lib/tw/client/request.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
module Tw
|
3
2
|
class Client
|
4
3
|
|
@@ -7,7 +6,9 @@ module Tw
|
|
7
6
|
Tw::Tweet.new(:id => m.id,
|
8
7
|
:user => m.user.screen_name,
|
9
8
|
:text => m.text,
|
10
|
-
:time => m.created_at
|
9
|
+
:time => m.created_at,
|
10
|
+
:fav_count => m.favorite_count,
|
11
|
+
:rt_count => m.retweet_count)
|
11
12
|
}
|
12
13
|
end
|
13
14
|
|
@@ -16,7 +17,9 @@ module Tw
|
|
16
17
|
Tw::Tweet.new(:id => m.id,
|
17
18
|
:user => m.from_user,
|
18
19
|
:text => m.text,
|
19
|
-
:time => m.created_at
|
20
|
+
:time => m.created_at,
|
21
|
+
:fav_count => m.favorite_count,
|
22
|
+
:rt_count => m.retweet_count)
|
20
23
|
}
|
21
24
|
end
|
22
25
|
|
@@ -25,7 +28,9 @@ module Tw
|
|
25
28
|
Tw::Tweet.new(:id => m.id,
|
26
29
|
:user => m.user.screen_name,
|
27
30
|
:text => m.text,
|
28
|
-
:time => m.created_at
|
31
|
+
:time => m.created_at,
|
32
|
+
:fav_count => m.favorite_count,
|
33
|
+
:rt_count => m.retweet_count)
|
29
34
|
}
|
30
35
|
end
|
31
36
|
|
@@ -34,7 +39,9 @@ module Tw
|
|
34
39
|
Tw::Tweet.new(:id => m.id,
|
35
40
|
:user => m.user.screen_name,
|
36
41
|
:text => m.text,
|
37
|
-
:time => m.created_at
|
42
|
+
:time => m.created_at,
|
43
|
+
:fav_count => m.favorite_count,
|
44
|
+
:rt_count => m.retweet_count)
|
38
45
|
}
|
39
46
|
end
|
40
47
|
|
@@ -43,7 +50,9 @@ module Tw
|
|
43
50
|
Tw::Tweet.new(:id => m.id,
|
44
51
|
:user => m.user.screen_name,
|
45
52
|
:text => m.text,
|
46
|
-
:time => m.created_at
|
53
|
+
:time => m.created_at,
|
54
|
+
:fav_count => m.favorite_count,
|
55
|
+
:rt_count => m.retweet_count)
|
47
56
|
}
|
48
57
|
end
|
49
58
|
|
data/lib/tw/client/tweet.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
module Tw
|
2
2
|
class Tweet
|
3
|
-
attr_reader :id, :user, :text, :time
|
3
|
+
attr_reader :id, :user, :text, :time, :fav_count, :rt_count
|
4
4
|
|
5
5
|
def initialize(opts)
|
6
6
|
@id = opts[:id]
|
7
7
|
@user = opts[:user]
|
8
8
|
@text = opts[:text]
|
9
9
|
@time = opts[:time]
|
10
|
+
@fav_count = opts[:fav_count]
|
11
|
+
@rt_count = opts[:rt_count]
|
10
12
|
end
|
11
13
|
|
12
14
|
def to_json(*a)
|
@@ -14,7 +16,9 @@ module Tw
|
|
14
16
|
:id => @id,
|
15
17
|
:user => @user,
|
16
18
|
:text => @text,
|
17
|
-
:time => @time
|
19
|
+
:time => @time,
|
20
|
+
:fav_count => @fav_count,
|
21
|
+
:rt_count => @rt_count
|
18
22
|
}.to_json(*a)
|
19
23
|
end
|
20
24
|
|
data/lib/tw/version.rb
CHANGED