jugyo-termtter 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -10,4 +10,5 @@ lib/termtter/notify-send.rb
10
10
  lib/termtter/standard_commands.rb
11
11
  lib/termtter/uri-open.rb
12
12
  test/test_termtter.rb
13
-
13
+ test/friends_timeline.json
14
+ test/search.json
data/README.rdoc CHANGED
@@ -21,7 +21,8 @@ Run:
21
21
 
22
22
  == INSTALL:
23
23
 
24
- sudo gem install jugyo-termtter -s http://gems.github.com
24
+ sudo gem source -a http://gems.github.com
25
+ sudo gem install jugyo-termtter
25
26
 
26
27
  == LICENSE:
27
28
 
@@ -27,7 +27,7 @@ class Termtter::Client
27
27
  end
28
28
 
29
29
  add_command /^show\s+([^\s]+)/ do |m, t|
30
- t.show($1)
30
+ t.show(m[1])
31
31
  end
32
32
 
33
33
  add_command /^pause\s*$/ do |m, t|
data/lib/termtter.rb CHANGED
@@ -10,7 +10,7 @@ $:.unshift(File.dirname(__FILE__)) unless
10
10
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
11
11
 
12
12
  module Termtter
13
- VERSION = '0.3.7'
13
+ VERSION = '0.3.8'
14
14
 
15
15
  class CommandNotFound < StandardError; end
16
16
 
@@ -119,7 +119,10 @@ module Termtter
119
119
  def get_timeline(uri, update_since_id = false)
120
120
  statuses = []
121
121
 
122
- JSON.parse(open(uri, :http_basic_authentication => [@user_name, @password]).read).each do |s|
122
+ data = JSON.parse(open(uri, :http_basic_authentication => [@user_name, @password]).read)
123
+ data = if data.instance_of? Array then data else [data] end
124
+
125
+ data.each do |s|
123
126
  u = s["user"]
124
127
  status = Status.new
125
128
  status.created_at = Time.utc(*ParseDate::parsedate(s["created_at"])).localtime
@@ -0,0 +1,3 @@
1
+ [{"in_reply_to_user_id":null,"truncated":false,"created_at":"Sat Jan 03 12:13:45 +0000 2009","user":{"description":"test2 xxxx","followers_count":102,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/000\/102.png","url":"http:\/\/twitter.com/test2","name":"Test User 2","protected":false,"screen_name":"test2","location":"Tokyo2","id":102},"favorited":false,"in_reply_to_screen_name":null,"text":"texttext 2","id":10002,"in_reply_to_status_id":null,"source":"<a href=\"http:\/\/ssss2\">ssss2<\/a>"},
2
+ {"in_reply_to_user_id":null,"truncated":false,"created_at":"Sat Jan 03 12:13:45 +0000 2009","user":{"description":"test1 xxxx","followers_count":101,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/000\/101.png","url":"http:\/\/twitter.com/test1","name":"Test User 1","protected":false,"screen_name":"test1","location":"Tokyo1","id":101},"favorited":false,"in_reply_to_screen_name":null,"text":"texttext 1","id":10001,"in_reply_to_status_id":null,"source":"<a href=\"http:\/\/ssss1\">ssss1<\/a>"},
3
+ {"in_reply_to_user_id":null,"truncated":false,"created_at":"Sat Jan 03 12:13:45 +0000 2009","user":{"description":"test0 xxxx","followers_count":100,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/000\/100.png","url":"http:\/\/twitter.com/test0","name":"Test User 0","protected":false,"screen_name":"test0","location":"Tokyo0","id":100},"favorited":false,"in_reply_to_screen_name":null,"text":"texttext 0","id":10000,"in_reply_to_status_id":null,"source":"<a href=\"http:\/\/ssss0\">ssss0<\/a>"},
data/test/search.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "results":[
3
+ {"text":"texttext 2","to_user_id":202,"to_user":"to_user2","from_user":"test2","id":10002,"from_user_id":102,"iso_language_code":"en","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/xxx\/102.jpg","created_at":"Sat, 03 Jan 2009 12:49:09 +0000"},
4
+ {"text":"texttext 1","to_user_id":101,"to_user":"to_user1","from_user":"test1","id":10001,"from_user_id":101,"iso_language_code":"en","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/xxx\/101.jpg","created_at":"Sat, 03 Jan 2009 12:49:09 +0000"},
5
+ {"text":"texttext 0","to_user_id":100,"to_user":"to_user0","from_user":"test0","id":10000,"from_user_id":100,"iso_language_code":"en","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/xxx\/100.jpg","created_at":"Sat, 03 Jan 2009 12:49:09 +0000"}
6
+ ],
7
+ "since_id":0,"max_id":1093328763,"refresh_url":"?since_id=1093328763&q=ruby","results_per_page":15,"next_page":"?page=2&max_id=1093328763&q=ruby","completed_in":0.019603,"page":1,"query":"ruby"
8
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jugyo-termtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-03 00:00:00 -08:00
12
+ date: 2009-01-04 00:00:00 -08:00
13
13
  default_executable: termtter
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -64,6 +64,8 @@ files:
64
64
  - lib/termtter/standard_commands.rb
65
65
  - lib/termtter/uri-open.rb
66
66
  - test/test_termtter.rb
67
+ - test/friends_timeline.json
68
+ - test/search.json
67
69
  has_rdoc: true
68
70
  homepage: http://github.com/jugyo/termtter
69
71
  post_install_message: PostInstall.txt