earthquake 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -1
- data/VERSION +1 -1
- data/earthquake.gemspec +2 -2
- data/lib/earthquake/commands.rb +14 -0
- data/lib/earthquake/core.rb +4 -0
- data/lib/earthquake/get_access_token.rb +1 -1
- data/lib/earthquake/output.rb +7 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -137,7 +137,12 @@ You can try it by using the :eval command:
|
|
137
137
|
|
138
138
|
⚡ :eval notify 'Hello World!'
|
139
139
|
|
140
|
-
|
140
|
+
Plugins
|
141
|
+
----
|
142
|
+
|
143
|
+
=> [https://github.com/jugyo/earthquake/wiki/Plugin](https://github.com/jugyo/earthquake/wiki/Plugin)
|
144
|
+
|
145
|
+
Making Plugin
|
141
146
|
----
|
142
147
|
|
143
148
|
**~/.earthquake/plugin** is the directory for plugins.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.3
|
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.3"
|
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-06}
|
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}
|
data/lib/earthquake/commands.rb
CHANGED
@@ -193,6 +193,20 @@ Earthquake.init do
|
|
193
193
|
}
|
194
194
|
end
|
195
195
|
|
196
|
+
command %r|^:open\s+(\d+)$|, :as => :open do |m|
|
197
|
+
if match = twitter.status(m[1])["text"].match(URI.regexp(["http", "https"]))
|
198
|
+
browse match[0]
|
199
|
+
else
|
200
|
+
puts "no link found".c(41)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
command %r|^:open\s+(\w+)$|, :as => :open do |m|
|
205
|
+
url = "https://twitter.com/#{m[1]}"
|
206
|
+
puts "Open: #{url}".c(:info)
|
207
|
+
browse url
|
208
|
+
end
|
209
|
+
|
196
210
|
command :sh do
|
197
211
|
system ENV["SHELL"] || 'sh'
|
198
212
|
end
|
data/lib/earthquake/core.rb
CHANGED
@@ -9,7 +9,7 @@ module Earthquake
|
|
9
9
|
request_token = consumer.get_request_token
|
10
10
|
|
11
11
|
puts "1) open: #{request_token.authorize_url}"
|
12
|
-
|
12
|
+
browse(request_token.authorize_url) rescue nil
|
13
13
|
|
14
14
|
print "2) Enter the PIN: "
|
15
15
|
pin = STDIN.gets.strip
|
data/lib/earthquake/output.rb
CHANGED
@@ -69,6 +69,7 @@ module Earthquake
|
|
69
69
|
:event => 42,
|
70
70
|
:url => [4, 36]
|
71
71
|
)
|
72
|
+
config[:raw_text] ||= false
|
72
73
|
|
73
74
|
output do |item|
|
74
75
|
next unless item["text"]
|
@@ -87,6 +88,7 @@ module Earthquake
|
|
87
88
|
id = id2var(item["id"])
|
88
89
|
|
89
90
|
text = item["text"].u
|
91
|
+
text.gsub!(/\s+/, ' ') unless config[:raw_text]
|
90
92
|
text.gsub!(/@([0-9A-Za-z_]+)/) do |i|
|
91
93
|
i.c(color_of($1))
|
92
94
|
end
|
@@ -99,7 +101,11 @@ module Earthquake
|
|
99
101
|
|
100
102
|
if item["_highlights"]
|
101
103
|
item["_highlights"].each do |h|
|
102
|
-
|
104
|
+
if config[:color][:highlight].nil?
|
105
|
+
c = color_of(h).to_i + 10
|
106
|
+
else
|
107
|
+
c = :highlight
|
108
|
+
end
|
103
109
|
text = text.gsub(/#{h}/i) do |i|
|
104
110
|
i.c(c)
|
105
111
|
end
|
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.3
|
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-06 00:00:00 +09:00
|
14
14
|
default_executable: earthquake
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|