weibo_oauth2 0.0.1 → 0.0.2

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 (2) hide show
  1. data/lib/sae_client2.rb +13 -9
  2. metadata +3 -3
data/lib/sae_client2.rb CHANGED
@@ -5,27 +5,31 @@ class SaeClient2
5
5
  @oauth = SaeOauth2.new(key, secret, access_token, refresh_token)
6
6
  end
7
7
 
8
+ def update(status)
9
+ self.oauth.post("https://api.weibo.com/2/statuses/update.json", {:status => status})
10
+ end
11
+
8
12
  def upload(status, pic_path, lat = nil, long = nil)
9
- self.oauth.post('https://api.t.sina.com.cn/statuses/upload.json', {:status => status, :pic => File.new(File.expand_path(pic_path))})
13
+ self.oauth.post('https://api.weibo.com/2/statuses/upload.json', {:status => status, :pic => File.new(File.expand_path(pic_path))})
10
14
  end
11
15
 
12
16
  def followers(cursor = -1, count = 200)
13
- self.oauth.get("https://api.t.sina.com.cn/statuses/followers.json", {:cursor => cursor, :count => count})
17
+ self.oauth.get("https://api.weibo.com/2/friendships/followers.json", {:cursor => cursor, :count => count})
14
18
  end
15
19
 
16
20
  def friends(cursor = -1, count = 200)
17
- self.oauth.get("https://api.t.sina.com.cn/statuses/friends.json", {:cursor => cursor, :count => count})
18
- end
19
-
20
- def update(status)
21
- self.oauth.post("https://api.t.sina.com.cn/statuses/update.json", {:status => status})
21
+ self.oauth.get("https://api.weibo.com/2/friendships/friends.json", {:cursor => cursor, :count => count})
22
22
  end
23
23
 
24
24
  def create_friendship(id)
25
- self.oauth.post("https://api.t.sina.com.cn/friendships/create.json", {:id => id})
25
+ self.oauth.post("https://api.weibo.com/2/friendships/create.json", {:id => id})
26
26
  end
27
27
 
28
28
  def users_show(id)
29
- self.oauth.get("https://api.t.sina.com.cn/users/show/#{id}.json")
29
+ self.oauth.get("https://api.weibo.com/2/users/show.json", {:uid => id})
30
+ end
31
+
32
+ def tags(id)
33
+ self.oauth.get("https://api.weibo.com/2/tags.json", {:uid => id})
30
34
  end
31
35
  end
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: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Li Guang