weibo_oauth2 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. data/lib/sae_client2.rb +9 -8
  2. data/lib/sae_oauth2.rb +2 -2
  3. metadata +4 -4
data/lib/sae_client2.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  class SaeClient2
2
2
  attr_reader :oauth
3
3
 
4
- def initialize(key, secret, access_token, refresh_token)
4
+ def initialize(key, secret, access_token, refresh_token, weibo_uid = nil)
5
5
  @oauth = SaeOauth2.new(key, secret, access_token, refresh_token)
6
+ @weibo_uid = weibo_uid
6
7
  end
7
8
 
8
9
  def update(status)
@@ -14,22 +15,22 @@ class SaeClient2
14
15
  end
15
16
 
16
17
  def followers(cursor = -1, count = 200)
17
- self.oauth.get("https://api.weibo.com/2/friendships/followers.json", {:cursor => cursor, :count => count})
18
+ self.oauth.get("https://api.weibo.com/2/friendships/followers.json", {:cursor => cursor, :count => count, :uid => @weibo_uid})
18
19
  end
19
20
 
20
21
  def friends(cursor = -1, count = 200)
21
- self.oauth.get("https://api.weibo.com/2/friendships/friends.json", {:cursor => cursor, :count => count})
22
+ self.oauth.get("https://api.weibo.com/2/friendships/friends.json", {:cursor => cursor, :count => count, :uid => @weibo_uid})
22
23
  end
23
24
 
24
- def create_friendship(id)
25
- self.oauth.post("https://api.weibo.com/2/friendships/create.json", {:id => id})
25
+ def create_friendship
26
+ self.oauth.post("https://api.weibo.com/2/friendships/create.json", {:uid => @weibo_uid})
26
27
  end
27
28
 
28
- def users_show(id)
29
- self.oauth.get("https://api.weibo.com/2/users/show.json", {:uid => id})
29
+ def users_show
30
+ self.oauth.get("https://api.weibo.com/2/users/show.json", {:uid => @weibo_uid})
30
31
  end
31
32
 
32
33
  def tags(id)
33
- self.oauth.get("https://api.weibo.com/2/tags.json", {:uid => id})
34
+ self.oauth.get("https://api.weibo.com/2/tags.json", {:uid => @weibo_uid})
34
35
  end
35
36
  end
data/lib/sae_oauth2.rb CHANGED
@@ -11,8 +11,8 @@ class SaeOauth2
11
11
  attr_reader :access_token_url, :authorize_url
12
12
 
13
13
  def initialize(client_id, client_secret, access_token = nil, refresh_token = nil)
14
- @access_token_url = "https://api.t.sina.com.cn/oauth2/access_token"
15
- @authorize_url = "https://api.t.sina.com.cn/oauth2/authorize"
14
+ @access_token_url = "https://api.weibo.com/oauth2/access_token"
15
+ @authorize_url = "https://api.weibo.com/oauth2/authorize"
16
16
 
17
17
  @client_id = client_id
18
18
  @client_secret = client_secret
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weibo_oauth2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Li Guang
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-08 00:00:00 Z
18
+ date: 2011-11-28 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: !binary |