moomerman-twitter_oauth 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
data/lib/twitter_oauth/client.rb
CHANGED
@@ -2,8 +2,8 @@ module TwitterOAuth
|
|
2
2
|
class Client
|
3
3
|
|
4
4
|
# Returns a list of the 20 most recent direct messages sent to the authenticating user.
|
5
|
-
def messages
|
6
|
-
oauth_response = access_token.get(
|
5
|
+
def messages(page=1)
|
6
|
+
oauth_response = access_token.get("/direct_messages.json?page=#{page}")
|
7
7
|
JSON.parse(oauth_response.body)
|
8
8
|
end
|
9
9
|
|
@@ -19,5 +19,11 @@ module TwitterOAuth
|
|
19
19
|
JSON.parse(oauth_response.body)
|
20
20
|
end
|
21
21
|
|
22
|
+
# Destroys the direct message specified in the required ID parameter.
|
23
|
+
def message_destroy(id)
|
24
|
+
oauth_response = access_token.post("/direct_messages/destroy/#{id}.json")
|
25
|
+
JSON.parse(oauth_response.body)
|
26
|
+
end
|
27
|
+
|
22
28
|
end
|
23
29
|
end
|
@@ -1,8 +1,13 @@
|
|
1
1
|
module TwitterOAuth
|
2
2
|
class Client
|
3
3
|
|
4
|
-
def
|
5
|
-
oauth_response = access_token.
|
4
|
+
def friends_ids
|
5
|
+
oauth_response = access_token.get("/friends/ids.json")
|
6
|
+
JSON.parse(oauth_response.body)
|
7
|
+
end
|
8
|
+
|
9
|
+
def followers_ids
|
10
|
+
oauth_response = access_token.get("/followers/ids.json")
|
6
11
|
JSON.parse(oauth_response.body)
|
7
12
|
end
|
8
13
|
|
@@ -8,14 +8,14 @@ module TwitterOAuth
|
|
8
8
|
end
|
9
9
|
|
10
10
|
# Returns the 20 most recent statuses posted by the authenticating user and that user's friends.
|
11
|
-
def friends_timeline
|
12
|
-
oauth_response = access_token.get(
|
11
|
+
def friends_timeline(rpp=20, page=1)
|
12
|
+
oauth_response = access_token.get("/statuses/friends_timeline.json?count=#{rpp}&page=#{page}")
|
13
13
|
JSON.parse(oauth_response.body)
|
14
14
|
end
|
15
15
|
|
16
16
|
# Returns the 20 most recent statuses posted from the authenticating user.
|
17
|
-
def user
|
18
|
-
oauth_response = access_token.get(
|
17
|
+
def user(page=1)
|
18
|
+
oauth_response = access_token.get("/statuses/user_timeline.json?page=#{page}")
|
19
19
|
JSON.parse(oauth_response.body)
|
20
20
|
end
|
21
21
|
|
@@ -32,8 +32,19 @@ module TwitterOAuth
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# Returns the 20 most recent @replies (status updates prefixed with @username) for the authenticating user.
|
35
|
-
def replies
|
36
|
-
oauth_response = access_token.get(
|
35
|
+
def replies(page=1)
|
36
|
+
oauth_response = access_token.get("/statuses/mentions.json?page=#{page}")
|
37
|
+
JSON.parse(oauth_response.body)
|
38
|
+
end
|
39
|
+
|
40
|
+
# alias
|
41
|
+
def mentions
|
42
|
+
replies
|
43
|
+
end
|
44
|
+
|
45
|
+
# Destroys the status specified by the required ID parameter
|
46
|
+
def status_destroy(id)
|
47
|
+
oauth_response = access_token.post("/statuses/destroy/#{id}.json")
|
37
48
|
JSON.parse(oauth_response.body)
|
38
49
|
end
|
39
50
|
|