fb_page_api 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fb_page_api.rb +8 -0
- data/lib/fb_page_api/edge/all.rb +2 -0
- data/lib/fb_page_api/edge/base.rb +11 -3
- data/lib/fb_page_api/edge/conversation.rb +13 -0
- data/lib/fb_page_api/edge/user.rb +9 -0
- data/lib/fb_page_api/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c06efeb097f935b89a6afa536ad53664fbd7ab3
|
4
|
+
data.tar.gz: 73e9f993b4866058d5fb438ddb6115df12c29144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f07d486cf12951e2b048a5ee5d01cc47c88b5374cbbbcc90e4dabaca02017d6b5b90f52dcc630e2bbb0b418e318fc8ab268fd2c644677ab2b5de33cefc671a
|
7
|
+
data.tar.gz: 7d072576a8e430332d900f5dbd065bf1956ec57379e708c3d17ecec533646883267fab14a38c47198cf2d2b2cd807758fa8f30a54d0c2660732515ccbcc4ef75
|
data/lib/fb_page_api.rb
CHANGED
data/lib/fb_page_api/edge/all.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module FbPageApi
|
2
2
|
module Edge
|
3
3
|
class Base
|
4
|
-
attr_accessor :parent_id, :page_after, :page_before
|
4
|
+
attr_accessor :parent_id, :page_after, :page_before, :next_url
|
5
5
|
|
6
6
|
def initialize(parent_id = Config.page_id)
|
7
7
|
self.parent_id = parent_id
|
@@ -11,11 +11,19 @@ module FbPageApi
|
|
11
11
|
options = args.extract_options!
|
12
12
|
@collection = []
|
13
13
|
begin
|
14
|
-
rs = http_request(:get, api_endpoint, query: body_params(options))
|
14
|
+
rs = http_request(:get, self.next_url || api_endpoint, query: body_params(options))
|
15
15
|
data = rs.parsed_response['data']
|
16
16
|
if data.present?
|
17
17
|
@collection = @collection | data
|
18
|
-
|
18
|
+
if rs.parsed_response['paging']['cursors'].present?
|
19
|
+
self.page_after = rs.parsed_response['paging']['cursors']['after']
|
20
|
+
self.next_url = nil
|
21
|
+
elsif rs.parsed_response['paging']['next'].present?
|
22
|
+
self.next_url = rs.parsed_response['paging']['next']
|
23
|
+
self.page_after = nil
|
24
|
+
else
|
25
|
+
data = []
|
26
|
+
end
|
19
27
|
end
|
20
28
|
end while data.present?
|
21
29
|
@collection
|
data/lib/fb_page_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb_page_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tuan Mai
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,6 +103,8 @@ files:
|
|
103
103
|
- lib/fb_page_api/edge/admin_note.rb
|
104
104
|
- lib/fb_page_api/edge/all.rb
|
105
105
|
- lib/fb_page_api/edge/base.rb
|
106
|
+
- lib/fb_page_api/edge/conversation.rb
|
107
|
+
- lib/fb_page_api/edge/user.rb
|
106
108
|
- lib/fb_page_api/version.rb
|
107
109
|
homepage: http://github.com/tuanmai/fb_page_api
|
108
110
|
licenses: []
|