rubytter 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/rubytter.rb +5 -4
  3. data/spec/rubytter_spec.rb +5 -5
  4. metadata +4 -15
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.4.1
data/lib/rubytter.rb CHANGED
@@ -32,6 +32,7 @@ class Rubytter
32
32
 
33
33
  def setup(options)
34
34
  @host = options[:host] || 'api.twitter.com'
35
+ @search_host = options[:search_host] || 'search.twitter.com'
35
36
  @header = {'User-Agent' => "Rubytter/#{VERSION} (http://github.com/jugyo/rubytter)"}
36
37
  @header.merge!(options[:header]) if options[:header]
37
38
  @app_name = options[:app_name]
@@ -189,9 +190,9 @@ class Rubytter
189
190
  path = '/search.json'
190
191
  param_str = '?' + to_param_str(params.merge({:q => query}))
191
192
  path = path + param_str unless param_str.empty?
192
- req = create_request(Net::HTTP::Get.new(path_prefix + path), false)
193
+ req = create_request(Net::HTTP::Get.new(path), false)
193
194
 
194
- json_data = http_request("#{@host}", req, nil, @connection_for_search)
195
+ json_data = http_request("#{@search_host}", req, nil, @connection_for_search)
195
196
  structize(
196
197
  json_data['results'].map do |result|
197
198
  search_result_to_hash(result)
@@ -213,8 +214,8 @@ class Rubytter
213
214
  'text' => json['text'],
214
215
  'source' => json['source'],
215
216
  'created_at' => json['created_at'],
216
- 'in_reply_to_user_id' => json['to_usre_id'],
217
- 'in_reply_to_screen_name' => json['to_usre'],
217
+ 'in_reply_to_user_id' => json['to_user_id'],
218
+ 'in_reply_to_screen_name' => json['to_user'],
218
219
  'in_reply_to_status_id' => nil,
219
220
  'user' => {
220
221
  'id' => json['from_user_id'],
@@ -111,8 +111,8 @@ class Rubytter
111
111
 
112
112
  it 'should respond to search (1)' do
113
113
  @rubytter.should_receive(:http_request) do |host, req, param_str|
114
- req.path.should == '/1/search.json?q=test'
115
- host.should == 'api.twitter.com'
114
+ req.path.should == '/search.json?q=test'
115
+ host.should == 'search.twitter.com'
116
116
  {'results' => []}
117
117
  end
118
118
  @rubytter.search('test')
@@ -289,8 +289,8 @@ class Rubytter
289
289
  'text' => 'foo foo bar bar',
290
290
  'created_at' => 'Sat, 21 Mar 2009 09:48:20 +0000',
291
291
  'source' => '<a href="http:\/\/twitter.com\/">web<\/a>',
292
- 'to_usre_id' => '20660692',
293
- 'to_usre' => 'jugyo_test',
292
+ 'to_user_id' => '20660692',
293
+ 'to_user' => 'jugyo_test',
294
294
  'from_user_id' => '3748631',
295
295
  'from_user' => 'jugyo',
296
296
  'profile_image_url' => 'http://s3.amazonaws.com/twitter_production/profile_images/63467667/megane2_normal.png'
@@ -414,7 +414,7 @@ class Rubytter
414
414
  connection_for_search.enable_ssl.should == false
415
415
 
416
416
  @ssl_rubytter.should_receive(:http_request).
417
- with('api.twitter.com', anything, nil, connection_for_search).
417
+ with('search.twitter.com', anything, nil, connection_for_search).
418
418
  and_return({'results' => []})
419
419
  @ssl_rubytter.search('rubytter')
420
420
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubytter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 4
9
- - 0
10
- version: 1.4.0
8
+ - 1
9
+ version: 1.4.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - jugyo
@@ -15,18 +14,16 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-06-22 00:00:00 +09:00
17
+ date: 2010-08-06 00:00:00 +09:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: json
23
22
  prerelease: false
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
25
  - - ">="
28
26
  - !ruby/object:Gem::Version
29
- hash: 21
30
27
  segments:
31
28
  - 1
32
29
  - 1
@@ -38,11 +35,9 @@ dependencies:
38
35
  name: oauth
39
36
  prerelease: false
40
37
  requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
39
  - - ">="
44
40
  - !ruby/object:Gem::Version
45
- hash: 31
46
41
  segments:
47
42
  - 0
48
43
  - 3
@@ -54,11 +49,9 @@ dependencies:
54
49
  name: rspec
55
50
  prerelease: false
56
51
  requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
52
  requirements:
59
53
  - - ">="
60
54
  - !ruby/object:Gem::Version
61
- hash: 3
62
55
  segments:
63
56
  - 0
64
57
  version: "0"
@@ -109,27 +102,23 @@ rdoc_options:
109
102
  require_paths:
110
103
  - lib
111
104
  required_ruby_version: !ruby/object:Gem::Requirement
112
- none: false
113
105
  requirements:
114
106
  - - ">="
115
107
  - !ruby/object:Gem::Version
116
- hash: 3
117
108
  segments:
118
109
  - 0
119
110
  version: "0"
120
111
  required_rubygems_version: !ruby/object:Gem::Requirement
121
- none: false
122
112
  requirements:
123
113
  - - ">="
124
114
  - !ruby/object:Gem::Version
125
- hash: 3
126
115
  segments:
127
116
  - 0
128
117
  version: "0"
129
118
  requirements: []
130
119
 
131
120
  rubyforge_project: rubytter
132
- rubygems_version: 1.3.7
121
+ rubygems_version: 1.3.6
133
122
  signing_key:
134
123
  specification_version: 3
135
124
  summary: Simple twitter client.