earthquake 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/earthquake.gemspec +3 -3
- data/lib/earthquake/core.rb +6 -1
- data/lib/earthquake/input.rb +0 -4
- data/lib/earthquake/output.rb +9 -5
- data/lib/earthquake/twitter.rb +2 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.7
|
data/earthquake.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{earthquake}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["jugyo"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-08}
|
13
13
|
s.default_executable = %q{earthquake}
|
14
14
|
s.description = %q{Twitter Client on Terminal with Twitter Streaming API.}
|
15
15
|
s.email = %q{jugyo.org@gmail.com}
|
@@ -60,7 +60,7 @@ Accordingly, you should renew the access token if it is old.
|
|
60
60
|
}
|
61
61
|
s.require_paths = ["lib"]
|
62
62
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
|
63
|
-
s.rubygems_version = %q{1.6.
|
63
|
+
s.rubygems_version = %q{1.6.2}
|
64
64
|
s.summary = %q{Twitter Client on Terminal.}
|
65
65
|
s.test_files = [
|
66
66
|
"spec/earthquake_spec.rb",
|
data/lib/earthquake/core.rb
CHANGED
@@ -94,13 +94,18 @@ module Earthquake
|
|
94
94
|
unless Readline::HISTORY.count == 1
|
95
95
|
Readline::HISTORY.pop if buf.empty? || Readline::HISTORY[-1] == Readline::HISTORY[-2]
|
96
96
|
end
|
97
|
-
sync {
|
97
|
+
sync {
|
98
|
+
reload
|
99
|
+
store_history
|
100
|
+
input(buf.strip)
|
101
|
+
}
|
98
102
|
end
|
99
103
|
end
|
100
104
|
|
101
105
|
Thread.start do
|
102
106
|
loop do
|
103
107
|
if Readline.line_buffer.nil? || Readline.line_buffer.empty?
|
108
|
+
reload
|
104
109
|
sync { output }
|
105
110
|
end
|
106
111
|
sleep 1
|
data/lib/earthquake/input.rb
CHANGED
@@ -28,7 +28,6 @@ module Earthquake
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def input(text)
|
31
|
-
reload
|
32
31
|
return if text.empty?
|
33
32
|
|
34
33
|
input_filters.each { |f| text = f.call(text) }
|
@@ -38,9 +37,6 @@ module Earthquake
|
|
38
37
|
elsif !text.empty?
|
39
38
|
puts "Command not found".c(43)
|
40
39
|
end
|
41
|
-
|
42
|
-
store_history
|
43
|
-
reload
|
44
40
|
rescue Exception => e
|
45
41
|
error e
|
46
42
|
end
|
data/lib/earthquake/output.rb
CHANGED
@@ -128,20 +128,24 @@ module Earthquake
|
|
128
128
|
end
|
129
129
|
|
130
130
|
output :delete do |item|
|
131
|
-
if item["delete"]
|
132
|
-
|
131
|
+
if item["delete"] && cache.read("status:#{item["delete"]["status"]["id"]}")
|
132
|
+
tweet = twitter.status(item["delete"]["status"]["id"])
|
133
|
+
tweet["_mark"] = "[deleted]".c(:event) + ' '
|
134
|
+
puts_items tweet
|
133
135
|
end
|
134
136
|
end
|
135
137
|
|
136
138
|
output :event do |item|
|
137
139
|
next unless item["event"]
|
138
140
|
|
139
|
-
#
|
141
|
+
print "[#{item["event"]}]".c(:event) + " "
|
140
142
|
case item["event"]
|
141
143
|
when "follow", "block", "unblock"
|
142
|
-
puts "
|
144
|
+
puts "#{item["source"]["screen_name"]} => #{item["target"]["screen_name"]}"
|
143
145
|
when "favorite", "unfavorite"
|
144
|
-
puts "
|
146
|
+
puts "#{item["source"]["screen_name"]} => #{item["target"]["screen_name"]} : #{item["target_object"]["text"].u}"
|
147
|
+
when "list_member_added", "list_member_removed"
|
148
|
+
puts "#{item["target_object"]["full_name"]} (#{item["target_object"]["description"]})"
|
145
149
|
else
|
146
150
|
if config[:debug]
|
147
151
|
ap item
|
data/lib/earthquake/twitter.rb
CHANGED
@@ -11,7 +11,8 @@ module Earthquake
|
|
11
11
|
next if item["text"].nil? || item["_disable_cache"]
|
12
12
|
item = item.dup
|
13
13
|
item.keys.select { |key| key =~ /^_/ }.each { |key| item.delete(key) } # remote optional data like "_stream", "_highlights"
|
14
|
-
|
14
|
+
cache_key = "status:#{item["id"]}"
|
15
|
+
cache.write(cache_key, item) unless cache.exist?(cache_key)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: earthquake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- jugyo
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-08 00:00:00 +09:00
|
14
14
|
default_executable: earthquake
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
requirements: []
|
206
206
|
|
207
207
|
rubyforge_project:
|
208
|
-
rubygems_version: 1.6.
|
208
|
+
rubygems_version: 1.6.2
|
209
209
|
signing_key:
|
210
210
|
specification_version: 3
|
211
211
|
summary: Twitter Client on Terminal.
|