tw 0.4.7 → 0.4.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 725b67193e0f0754306e91292430d780b42955cb
4
- data.tar.gz: 066d1fb0ef54f7b47d44ebe754b4318285dba466
3
+ metadata.gz: d187427630eeb401fbbbf16c9520d3c0e470e333
4
+ data.tar.gz: 496eec941e377850d175d49fa248f10194a82f67
5
5
  SHA512:
6
- metadata.gz: ab953dfae9099f4888f85be5bd8ef3bf0ada4623a58b691543b4b54e22f51ff97239466b5c60668014d620bb67835b344d3173d5e06ceaefa19c343522dd5e01
7
- data.tar.gz: ae1fdbcf859ed88437b70ce7395d2dacf20292769e227fa65cca773c5132b44d5295a6b4f77eb9fabd06b2648817c5412c32c39470afa7edf18f010d89f2f8f5
6
+ metadata.gz: 931dd7711379a66bca7809915c21afaae1f71a6a9f522e0ed54e0eefa5b640bf9ee73a7ba18b3cd949368475f21086d75ccb449e37ce8092eead7077a798539d
7
+ data.tar.gz: f5040f148bba10725dc0b4a7ec7cd8886f46a3c5c595efe5668981fe39daaf7591c93b139265fcd16ff06f234c093f911e570a6d87ddf74080895aedd65d5c4b
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.4.8 2013-08-10
2
+
3
+ * show Fav/RT count
4
+
1
5
  === 0.4.7 2013-08-09
2
6
 
3
7
  * modify DM send dialog
data/lib/tw/app/cmds.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  module Tw::App
3
2
  class Main
4
3
 
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
@@ -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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Tw
2
- VERSION = '0.4.7'
2
+ VERSION = '0.4.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto