tit 2.0.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.markdown +9 -0
- data/VERSION.yml +1 -1
- data/bin/tit +4 -1
- data/lib/tit.rb +7 -3
- data/tit.gemspec +1 -1
- metadata +2 -2
data/ChangeLog.markdown
CHANGED
data/VERSION.yml
CHANGED
data/bin/tit
CHANGED
@@ -49,6 +49,9 @@ def main
|
|
49
49
|
options[:payload]["status"] = status
|
50
50
|
end
|
51
51
|
opts.on("-d", "--dm [USERNAME] [MESSAGE]", "Read direct messages. Send a direct message if USERNAME and MESSAGE are set") do |user, message|
|
52
|
+
"Tit does not presently have access to Twitter's Direct Messaging functionality. This will be rectified soon.".wrapped(@cols-2).each do |l|
|
53
|
+
puts " #{l}"
|
54
|
+
end
|
52
55
|
unchanged = false
|
53
56
|
if not user.nil? and not message.nil?
|
54
57
|
options[:action] = :new_direct_message
|
@@ -158,7 +161,7 @@ def main
|
|
158
161
|
tit.abort("can't notify when updating status") unless options[:notify].nil?
|
159
162
|
end
|
160
163
|
if options[:action] == :new_direct_message
|
161
|
-
tit.abort("need message to send a dm") unless options[:payload].include? "
|
164
|
+
tit.abort("need message to send a dm") unless options[:payload].include? "text"
|
162
165
|
tit.abort("can't repeatedly update status") unless options[:wait].nil?
|
163
166
|
tit.abort("can't notify when updating status") unless options[:notify].nil?
|
164
167
|
end
|
data/lib/tit.rb
CHANGED
@@ -91,7 +91,7 @@ end
|
|
91
91
|
Why are you reading the documentation, you cunt?
|
92
92
|
=end
|
93
93
|
class Tit
|
94
|
-
VERSION = [2, 0,
|
94
|
+
VERSION = [2, 0, 3]
|
95
95
|
|
96
96
|
RCFILE = File.join(ENV["HOME"], ".titrc")
|
97
97
|
RTFILE = File.join(ENV["HOME"], ".titrt")
|
@@ -179,6 +179,7 @@ class Tit
|
|
179
179
|
end
|
180
180
|
api_endpoint.concat("&include_entities=true")
|
181
181
|
coder = HTMLEntities.new
|
182
|
+
#puts @access_token.get(api_endpoint).body
|
182
183
|
Nokogiri.XML(@access_token.get(api_endpoint).body).xpath("//status").map do |xml|
|
183
184
|
{
|
184
185
|
:username => xml.at_xpath("./user/name").content,
|
@@ -209,6 +210,8 @@ class Tit
|
|
209
210
|
payload["status"] = STDIN.read
|
210
211
|
end
|
211
212
|
|
213
|
+
# Count URLs only as t.co length, not full length.
|
214
|
+
|
212
215
|
if payload["status"].length > 140
|
213
216
|
tuts "your status is too long (by #{payload["status"].length - 140} characters)"
|
214
217
|
tuts "here is what would get posted:"
|
@@ -220,6 +223,7 @@ class Tit
|
|
220
223
|
end
|
221
224
|
|
222
225
|
def send_dm(payload)
|
226
|
+
# Count URLs only as t.co length, not full length.
|
223
227
|
if payload["text"].length > 140
|
224
228
|
tuts "your message is too long (by #{payload["text"].length - 140} characters)"
|
225
229
|
tuts "here is what would get posted:"
|
@@ -297,8 +301,8 @@ class Tit
|
|
297
301
|
end
|
298
302
|
|
299
303
|
def update_count(count)
|
300
|
-
@prefs[:count] = count
|
301
|
-
@prefs["count"] = count
|
304
|
+
@prefs[:count] = count.to_i
|
305
|
+
@prefs["count"] = count.to_i
|
302
306
|
File.open(RCFILE, "w") do |rc|
|
303
307
|
YAML.dump(@prefs, rc)
|
304
308
|
end
|
data/tit.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.0.
|
5
|
+
version: 2.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Leif Walsh
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements: []
|
92
92
|
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 1.8.
|
94
|
+
rubygems_version: 1.8.10
|
95
95
|
signing_key:
|
96
96
|
specification_version: 3
|
97
97
|
summary: stupid fucking twitter client
|