weibo 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/weibo.rb +4 -4
- data/lib/weibo/base.rb +11 -3
- data/lib/weibo/oauth.rb +1 -1
- data/weibo.gemspec +8 -9
- data/weibo.yml.example +1 -1
- metadata +141 -146
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.12
|
data/lib/weibo.rb
CHANGED
@@ -57,12 +57,12 @@ end
|
|
57
57
|
|
58
58
|
|
59
59
|
if File.exists?('config/weibo.yml')
|
60
|
-
weibo_oauth = YAML.load_file('config/weibo.yml')[
|
60
|
+
weibo_oauth = YAML.load_file('config/weibo.yml')[ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"]
|
61
61
|
Weibo::Config.api_key = weibo_oauth["api_key"]
|
62
62
|
Weibo::Config.api_secret = weibo_oauth["api_secret"]
|
63
|
-
else
|
63
|
+
else
|
64
64
|
puts "\n\n=========================================================\n\n" +
|
65
|
-
" You haven't made a config/weibo.yml file.\n\n You should. \n\n The weibo gem will work much better if you do\n\n" +
|
65
|
+
" You haven't made a config/weibo.yml file.\n\n You should. \n\n The weibo gem will work much better if you do\n\n" +
|
66
66
|
" Please set Weibo::Config.api_key and \n Weibo::Config.api_secret\n somewhere in your initialization process\n\n" +
|
67
67
|
"=========================================================\n\n"
|
68
68
|
end
|
@@ -72,4 +72,4 @@ if Rails
|
|
72
72
|
require 'weibo/railtie'
|
73
73
|
end
|
74
74
|
rescue
|
75
|
-
end
|
75
|
+
end
|
data/lib/weibo/base.rb
CHANGED
@@ -93,9 +93,11 @@ module Weibo
|
|
93
93
|
end
|
94
94
|
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
#statuses/upload 发送带图片的微博,可带地理位置信息
|
97
|
+
#options: status, pic, lat, long
|
98
|
+
def upload(status, file, query={})
|
99
|
+
PostBodyHack.apply_hack({:status => status}.merge(query)) do
|
100
|
+
perform_post("/statuses/upload.json", build_multipart_bodies({:pic => file, :status => status}.merge(query)))
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
@@ -343,6 +345,12 @@ module Weibo
|
|
343
345
|
perform_delete("/tags/destroy_batch.json", :body => {:ids => ids})
|
344
346
|
end
|
345
347
|
|
348
|
+
# Emotions
|
349
|
+
# List of emotions
|
350
|
+
def emotions(query={})
|
351
|
+
perform_get("/emotions.json", :query => query)
|
352
|
+
end
|
353
|
+
|
346
354
|
protected
|
347
355
|
def self.mime_type(file)
|
348
356
|
case
|
data/lib/weibo/oauth.rb
CHANGED
@@ -14,7 +14,7 @@ module Weibo
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def consumer
|
17
|
-
@consumer ||= ::OAuth::Consumer.new(@ctoken, @csecret, {:site => 'http://api.
|
17
|
+
@consumer ||= ::OAuth::Consumer.new(@ctoken, @csecret, {:site => 'http://api.weibo.com'}.merge(consumer_options))
|
18
18
|
end
|
19
19
|
|
20
20
|
def set_callback_url(url)
|
data/weibo.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.0.
|
7
|
+
s.name = "weibo"
|
8
|
+
s.version = "0.0.12"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Scott Ballantyne"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2012-06-04"
|
13
|
+
s.description = "this gem is an adaptation of John Nunemaker's Twitter gem. I modified it to make api integration for \u{65b0}\u{6d6a}\u{5fae}\u{535a} (t.sina.com.cn) easier."
|
14
|
+
s.email = "ussballantyne@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
17
|
"README.rdoc"
|
@@ -44,13 +44,12 @@ Gem::Specification.new do |s|
|
|
44
44
|
"weibo.gemspec",
|
45
45
|
"weibo.yml.example"
|
46
46
|
]
|
47
|
-
s.homepage =
|
47
|
+
s.homepage = "http://github.com/ballantyne/weibo"
|
48
48
|
s.require_paths = ["lib"]
|
49
|
-
s.rubygems_version =
|
50
|
-
s.summary =
|
49
|
+
s.rubygems_version = "1.8.21"
|
50
|
+
s.summary = "a gem to help api integration for \u{65b0}\u{6d6a}\u{5fae}\u{535a} (t.sina.com.cn)"
|
51
51
|
|
52
52
|
if s.respond_to? :specification_version then
|
53
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
54
53
|
s.specification_version = 3
|
55
54
|
|
56
55
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
data/weibo.yml.example
CHANGED
metadata
CHANGED
@@ -1,163 +1,169 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: weibo
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 11
|
10
|
-
version: 0.0.11
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.12
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Scott Ballantyne
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
12
|
+
date: 2012-06-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
24
15
|
name: oauth
|
25
|
-
|
26
|
-
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 0
|
33
|
-
version: "0"
|
34
|
-
requirement: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
36
22
|
type: :runtime
|
37
23
|
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
38
31
|
name: hashie
|
39
|
-
|
40
|
-
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
version: "0"
|
48
|
-
requirement: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
50
38
|
type: :runtime
|
51
39
|
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
52
47
|
name: httparty
|
53
|
-
|
54
|
-
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
version: "0"
|
62
|
-
requirement: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
64
54
|
type: :runtime
|
65
55
|
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
66
63
|
name: crack
|
67
|
-
|
68
|
-
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
segments:
|
74
|
-
- 0
|
75
|
-
version: "0"
|
76
|
-
requirement: *id004
|
77
|
-
- !ruby/object:Gem::Dependency
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
78
70
|
type: :runtime
|
79
71
|
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
80
79
|
name: jeweler
|
81
|
-
|
82
|
-
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
|
88
|
-
- 0
|
89
|
-
version: "0"
|
90
|
-
requirement: *id005
|
91
|
-
- !ruby/object:Gem::Dependency
|
92
|
-
type: :development
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
93
87
|
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
94
95
|
name: thoughtbot-shoulda
|
95
|
-
|
96
|
-
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
|
102
|
-
- 0
|
103
|
-
version: "0"
|
104
|
-
requirement: *id006
|
105
|
-
- !ruby/object:Gem::Dependency
|
106
|
-
type: :runtime
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
107
103
|
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
108
111
|
name: oauth
|
109
|
-
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
110
113
|
none: false
|
111
|
-
requirements:
|
114
|
+
requirements:
|
112
115
|
- - ~>
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
hash: 13
|
115
|
-
segments:
|
116
|
-
- 0
|
117
|
-
- 4
|
118
|
-
- 1
|
116
|
+
- !ruby/object:Gem::Version
|
119
117
|
version: 0.4.1
|
120
|
-
requirement: *id007
|
121
|
-
- !ruby/object:Gem::Dependency
|
122
118
|
type: :runtime
|
123
119
|
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.4.1
|
126
|
+
- !ruby/object:Gem::Dependency
|
124
127
|
name: hashie
|
125
|
-
|
126
|
-
none: false
|
127
|
-
requirements:
|
128
|
-
- -
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
segments:
|
132
|
-
- 0
|
133
|
-
version: "0"
|
134
|
-
requirement: *id008
|
135
|
-
- !ruby/object:Gem::Dependency
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
136
134
|
type: :runtime
|
137
135
|
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
138
143
|
name: httparty
|
139
|
-
|
140
|
-
none: false
|
141
|
-
requirements:
|
142
|
-
- -
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: 0.5.2
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
149
157
|
version: 0.5.2
|
150
|
-
|
151
|
-
|
158
|
+
description: this gem is an adaptation of John Nunemaker's Twitter gem. I modified
|
159
|
+
it to make api integration for 新浪微博 (t.sina.com.cn) easier.
|
152
160
|
email: ussballantyne@gmail.com
|
153
161
|
executables: []
|
154
|
-
|
155
162
|
extensions: []
|
156
|
-
|
157
|
-
extra_rdoc_files:
|
163
|
+
extra_rdoc_files:
|
158
164
|
- LICENSE
|
159
165
|
- README.rdoc
|
160
|
-
files:
|
166
|
+
files:
|
161
167
|
- .document
|
162
168
|
- .rspec
|
163
169
|
- Gemfile
|
@@ -184,39 +190,28 @@ files:
|
|
184
190
|
- spec/weibo_spec.rb
|
185
191
|
- weibo.gemspec
|
186
192
|
- weibo.yml.example
|
187
|
-
has_rdoc: true
|
188
193
|
homepage: http://github.com/ballantyne/weibo
|
189
194
|
licenses: []
|
190
|
-
|
191
195
|
post_install_message:
|
192
196
|
rdoc_options: []
|
193
|
-
|
194
|
-
require_paths:
|
197
|
+
require_paths:
|
195
198
|
- lib
|
196
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
199
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
197
200
|
none: false
|
198
|
-
requirements:
|
199
|
-
- -
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
|
202
|
-
|
203
|
-
- 0
|
204
|
-
version: "0"
|
205
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
|
+
requirements:
|
202
|
+
- - ! '>='
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: '0'
|
205
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
206
|
none: false
|
207
|
-
requirements:
|
208
|
-
- -
|
209
|
-
- !ruby/object:Gem::Version
|
210
|
-
|
211
|
-
segments:
|
212
|
-
- 0
|
213
|
-
version: "0"
|
207
|
+
requirements:
|
208
|
+
- - ! '>='
|
209
|
+
- !ruby/object:Gem::Version
|
210
|
+
version: '0'
|
214
211
|
requirements: []
|
215
|
-
|
216
212
|
rubyforge_project:
|
217
|
-
rubygems_version: 1.
|
213
|
+
rubygems_version: 1.8.21
|
218
214
|
signing_key:
|
219
215
|
specification_version: 3
|
220
|
-
summary:
|
216
|
+
summary: a gem to help api integration for 新浪微博 (t.sina.com.cn)
|
221
217
|
test_files: []
|
222
|
-
|