moomerman-twitter_oauth 0.1.10 → 0.1.11

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.
@@ -6,6 +6,7 @@ require 'twitter_oauth/notifications'
6
6
  require 'twitter_oauth/blocks'
7
7
  require 'twitter_oauth/friendships'
8
8
  require 'twitter_oauth/user'
9
+ require 'twitter_oauth/favorites'
9
10
 
10
11
  module TwitterOAuth
11
12
  class Client
@@ -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('/direct_messages.json')
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 friends
5
- oauth_response = access_token.post("/friends/ids.json")
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('/statuses/friends_timeline.json')
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('/statuses/user_timeline.json')
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('/statuses/replies.json')
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
 
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.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor