bobot 3.0.5 → 3.0.6
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.
- checksums.yaml +4 -4
- data/lib/bobot/graph_facebook.rb +8 -5
- data/lib/bobot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6242f80c9f259f76b1cf42f8f60640334c953dce
|
4
|
+
data.tar.gz: 864e52849f19a3f0b0632d69ca9dff57d9ed547b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c2d76f522226c7449d57553dd1992139358b6029506f735e46b3d49407ab5df110007ccf74fd297a2110684b98a794d67adb97a49aaf23850bfd4d27ba53817
|
7
|
+
data.tar.gz: 5d1a0357b9bbcc4d06646d0543d1789b22de492fee212374ab9aeb5820b7a21c36b861c823d112e059523fb1247839d345a2bf45b79a8215e5dbf0eec69f8f80
|
data/lib/bobot/graph_facebook.rb
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
-
require "
|
1
|
+
require "typhoeus"
|
2
2
|
require "uri"
|
3
3
|
|
4
4
|
module Bobot
|
5
5
|
module GraphFacebook
|
6
|
-
GRAPH_FB_URL = 'https://graph.facebook.com/v2.11
|
6
|
+
GRAPH_FB_URL = 'https://graph.facebook.com/v2.11'.freeze
|
7
7
|
GRAPH_HEADERS = { Accept: "application/json", "Content-Type" => "application/json; charset=utf-8" }.freeze
|
8
8
|
|
9
9
|
module ClassMethods
|
10
10
|
def graph_get(path, query: {})
|
11
11
|
url = "#{GRAPH_FB_URL}#{path}".freeze
|
12
|
-
req = Typhoeus::Request.new(
|
12
|
+
req = ::Typhoeus::Request.new(
|
13
13
|
url,
|
14
14
|
method: :get,
|
15
15
|
params: URI.encode_www_form(query.reverse_merge(include_headers: false)),
|
16
16
|
headers: GRAPH_HEADERS,
|
17
17
|
ssl_verifypeer: false,
|
18
|
+
verbose: false,
|
18
19
|
).run
|
19
20
|
response = req.run
|
20
21
|
json = ActiveSupport::JSON.decode(response.send(:body) || '{}')
|
@@ -27,13 +28,14 @@ module Bobot
|
|
27
28
|
|
28
29
|
def graph_post(path, query: {}, body: {})
|
29
30
|
url = "#{GRAPH_FB_URL}#{path}".freeze
|
30
|
-
req = Typhoeus::Request.new(
|
31
|
+
req = ::Typhoeus::Request.new(
|
31
32
|
url,
|
32
33
|
method: :post,
|
33
34
|
params: URI.encode_www_form(query.reverse_merge(include_headers: false)),
|
34
35
|
body: ActiveSupport::JSON.encode(body),
|
35
36
|
headers: GRAPH_HEADERS,
|
36
37
|
ssl_verifypeer: false,
|
38
|
+
verbose: false,
|
37
39
|
)
|
38
40
|
response = req.run
|
39
41
|
json = ActiveSupport::JSON.decode(response.send(:body) || '{}')
|
@@ -46,13 +48,14 @@ module Bobot
|
|
46
48
|
|
47
49
|
def graph_delete(path, query: {}, body: {})
|
48
50
|
url = "#{GRAPH_FB_URL}#{path}".freeze
|
49
|
-
req = Typhoeus::Request.new(
|
51
|
+
req = ::Typhoeus::Request.new(
|
50
52
|
url,
|
51
53
|
method: :delete,
|
52
54
|
params: URI.encode_www_form(query.reverse_merge(include_headers: false)),
|
53
55
|
body: ActiveSupport::JSON.encode(body),
|
54
56
|
headers: GRAPH_HEADERS,
|
55
57
|
ssl_verifypeer: false,
|
58
|
+
verbose: false,
|
56
59
|
)
|
57
60
|
response = req.run
|
58
61
|
json = ActiveSupport::JSON.decode(response.send(:body) || '{}')
|
data/lib/bobot/version.rb
CHANGED