tit 2.0.1 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,12 @@
1
+ # tit 2.0.3 2011-08-31
2
+
3
+ *
4
+
5
+ # tit 2.0.2 2011-08-31
6
+
7
+ * dm-ing still not working - twitter needs to give us permission
8
+ * fixed code for dm-ing when twitter approves it, it'll work
9
+
1
10
  # tit 2.0.1 2011-08-23
2
11
 
3
12
  * fixed bug with the count
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 2
3
3
  :minor: 0
4
- :patch: 1
4
+ :patch: 3
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? "message"
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, 1]
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tit}
8
- s.version = "2.0.1"
8
+ s.version = "2.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Leif Walsh", "Parker Moore"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: tit
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.1
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.8
94
+ rubygems_version: 1.8.10
95
95
  signing_key:
96
96
  specification_version: 3
97
97
  summary: stupid fucking twitter client