moomerman-twitter_oauth 0.1.9 → 0.1.9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twitter_oauth/blocks.rb +17 -0
- data/lib/twitter_oauth/client.rb +4 -1
- data/lib/twitter_oauth/friendships.rb +28 -0
- data/lib/twitter_oauth/notifications.rb +17 -0
- metadata +4 -1
@@ -0,0 +1,17 @@
|
|
1
|
+
module TwitterOAuth
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# unblock this user.
|
5
|
+
def block(id)
|
6
|
+
oauth_response = access_token.post("/blocks/create/#{id}.json")
|
7
|
+
JSON.parse(oauth_response.body)
|
8
|
+
end
|
9
|
+
|
10
|
+
# block this user.
|
11
|
+
def unblock(id)
|
12
|
+
oauth_response = access_token.post("/blocks/destroy/#{id}.json")
|
13
|
+
JSON.parse(oauth_response.body)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
data/lib/twitter_oauth/client.rb
CHANGED
@@ -2,6 +2,9 @@ require 'twitter_oauth/account'
|
|
2
2
|
require 'twitter_oauth/statuses'
|
3
3
|
require 'twitter_oauth/direct_messages'
|
4
4
|
require 'twitter_oauth/search'
|
5
|
+
require 'twitter_oauth/notifications'
|
6
|
+
require 'twitter_oauth/blocks'
|
7
|
+
require 'twitter_oauth/friendships'
|
5
8
|
|
6
9
|
module TwitterOAuth
|
7
10
|
class Client
|
@@ -46,4 +49,4 @@ module TwitterOAuth
|
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
49
|
-
|
52
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module TwitterOAuth
|
2
|
+
class Client
|
3
|
+
|
4
|
+
def friends
|
5
|
+
oauth_response = access_token.post("friends/ids.json")
|
6
|
+
JSON.parse(oauth_response.body)
|
7
|
+
end
|
8
|
+
|
9
|
+
# friend this user.
|
10
|
+
def friend(id)
|
11
|
+
oauth_response = access_token.post("/friendships/create/#{id}.json")
|
12
|
+
JSON.parse(oauth_response.body)
|
13
|
+
end
|
14
|
+
|
15
|
+
# unfriend.
|
16
|
+
def unfriend(id)
|
17
|
+
oauth_response = access_token.post("/friendships/destroy/#{id}.json")
|
18
|
+
JSON.parse(oauth_response.body)
|
19
|
+
end
|
20
|
+
|
21
|
+
# exists?.
|
22
|
+
def exists?(a, b)
|
23
|
+
oauth_response = access_token.get("/friendships/exists.json?user_a=#{a}&user_b=#{b}")
|
24
|
+
JSON.parse(oauth_response.body)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module TwitterOAuth
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# follow this user.
|
5
|
+
def follow(id)
|
6
|
+
oauth_response = access_token.post("/notifications/follow/#{id}.json")
|
7
|
+
JSON.parse(oauth_response.body)
|
8
|
+
end
|
9
|
+
|
10
|
+
# unfollow.
|
11
|
+
def leave(id)
|
12
|
+
oauth_response = access_token.post("/notifications/leave/#{id}.json")
|
13
|
+
JSON.parse(oauth_response.body)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moomerman-twitter_oauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.9
|
4
|
+
version: 0.1.9.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Taylor
|
@@ -49,6 +49,9 @@ files:
|
|
49
49
|
- lib/twitter_oauth/statuses.rb
|
50
50
|
- lib/twitter_oauth/direct_messages.rb
|
51
51
|
- lib/twitter_oauth/search.rb
|
52
|
+
- lib/twitter_oauth/blocks.rb
|
53
|
+
- lib/twitter_oauth/friendships.rb
|
54
|
+
- lib/twitter_oauth/notifications.rb
|
52
55
|
has_rdoc: false
|
53
56
|
homepage: http://github.com/moomerman/twitter_oauth
|
54
57
|
post_install_message:
|