oauth_china 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/oauth_china/strategies/sohu.rb +34 -0
- data/lib/oauth_china/version.rb +1 -1
- data/lib/oauth_china.rb +1 -0
- metadata +4 -3
@@ -0,0 +1,34 @@
|
|
1
|
+
module OauthChina
|
2
|
+
class Sohu < OauthChina::OAuth
|
3
|
+
|
4
|
+
def initialize(*args)
|
5
|
+
#fuck sohu...!!
|
6
|
+
#搜狐微博的OAUTH 只支持将OAuth的认证参数放在HTTP的头部中。而且不可以带realm参数
|
7
|
+
self.consumer_options = {
|
8
|
+
:site => 'http://api.t.sohu.com',
|
9
|
+
:scheme => :header,
|
10
|
+
:request_token_path => '/oauth/request_token',
|
11
|
+
:access_token_path => '/oauth/access_token',
|
12
|
+
:authorize_path => '/oauth/authorize'
|
13
|
+
}
|
14
|
+
super(*args)
|
15
|
+
end
|
16
|
+
|
17
|
+
def name
|
18
|
+
:sohu
|
19
|
+
end
|
20
|
+
|
21
|
+
def authorized?
|
22
|
+
#TODO
|
23
|
+
end
|
24
|
+
|
25
|
+
def destroy
|
26
|
+
#TODO
|
27
|
+
end
|
28
|
+
|
29
|
+
def add_status(content, options = {})
|
30
|
+
options.merge!(:status => content)
|
31
|
+
self.post("http://api.t.sohu.com/statuses/update.json", options)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/oauth_china/version.rb
CHANGED
data/lib/oauth_china.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth_china
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Hooopo
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/oauth_china/strategies/douban.rb
|
54
54
|
- lib/oauth_china/strategies/qq.rb
|
55
55
|
- lib/oauth_china/strategies/sina.rb
|
56
|
+
- lib/oauth_china/strategies/sohu.rb
|
56
57
|
- lib/oauth_china/version.rb
|
57
58
|
- oauth_china.gemspec
|
58
59
|
has_rdoc: true
|