tida_sina_weibo 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
@@ -12,11 +12,11 @@ module TidaSinaWeibo
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def status_update(content)
|
15
|
-
post_request(api_settings.status.update, :status => content)
|
15
|
+
post_request(api_settings.status.update, :params => {:status => content})
|
16
16
|
end
|
17
17
|
|
18
18
|
def status_upload(content, image_path)
|
19
|
-
post_request(api_settings.status.upload, :status => content, :pic => File.new(image_path, 'rb'))
|
19
|
+
post_request(api_settings.status.upload, :params => {:status => content, :pic => File.new(image_path, 'rb')})
|
20
20
|
end
|
21
21
|
|
22
22
|
def status_user_timeline(uid, page = 1, count = 100)
|
@@ -88,13 +88,16 @@ module TidaSinaWeibo
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def do_request(url, data, method_post)
|
91
|
-
rd = data.clone
|
92
|
-
params = {:access_token => @access_token}
|
93
|
-
rd[:params] = data[:params].merge(params)
|
94
|
-
|
95
91
|
if method_post
|
92
|
+
rd = data.clone
|
93
|
+
rd[:access_token] = @access_token
|
94
|
+
r = JSON.parse RestClient.post(url, rd)
|
95
|
+
Rails.logger.debug "- Request response: #{r}"
|
96
96
|
return rest_client.post(url, rd)
|
97
97
|
else
|
98
|
+
rd = data.clone
|
99
|
+
params = {:access_token => @access_token}
|
100
|
+
rd[:params] = data[:params].merge(params)
|
98
101
|
return rest_client.get(url, rd)
|
99
102
|
end
|
100
103
|
rescue RestClientException => e
|