ruby_meta_graph 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fa3b4334887bfd385536a23656cf857ddea7419e603d38e402efdf5b9c25f8d1
4
+ data.tar.gz: 18cf45edb84e39e947032ac6a10b5fd053bc121132d2cf0f57e094ab0e270c3e
5
+ SHA512:
6
+ metadata.gz: 88403a9c2ef29f9bddf691b94fcd339979e4e03a20c63ce913e6c1c1938ac88f48db5407e0bf1440b85777f6ef6bfe8c0408f375101969dbbef1536f629626d8
7
+ data.tar.gz: 43f622640ee5e32224b090e1368f969cc54167d48f338b735b6c075d6457abc57a5c5f43853d4526392d4ee734837106e2d76aa3415c99082856b2c3c1c895ed
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2023 Adham Kurniawan
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Ruby Meta Graph
2
+
3
+ [![CircleCI](https://dl.circleci.com/status-badge/img/gh/dhamkur/ruby-meta-graph/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/dhamkur/ruby-meta-graph/tree/main)
4
+
5
+ Ruby for Meta Graph API. Features:
6
+
7
+ 1. Easy setup
8
+ 2. Response object
9
+ 3. Custom permission
10
+ 4. Latest version of Meta Graph API
11
+
12
+ How to install:
13
+
14
+ ```sh
15
+ gem install ruby_meta_graph
16
+ ```
17
+
18
+ How to use:
19
+
20
+ ```sh
21
+ permission = "id,name,email,birthday"
22
+ your_token = ENV[TOKEN]
23
+ response = RubyMetaGraph.new(permission, your_token).run
24
+
25
+ # The responses will be base on permission you allowed
26
+ response.id
27
+ response.name
28
+ response.email
29
+ response.birthday
30
+ ```
31
+
32
+ ## Credits
33
+
34
+ Made base on my use case to keep the large application maintainable by separate the service. [Adham Kurniawan](https://github.com/dhamkur)
@@ -0,0 +1,21 @@
1
+ module RubyMetaGraph
2
+ class Me
3
+ include RubyMetaGraph
4
+
5
+ def initialize(fields, access)
6
+ @fields = fields
7
+ @access = access
8
+ end
9
+
10
+ def run
11
+ response = connect.get(
12
+ "me", {
13
+ fields: @fields,
14
+ access_token: @access
15
+ }
16
+ )
17
+
18
+ return JSON.parse(response.body, object_class: OpenStruct)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,3 @@
1
+ module RubyMetaGraph
2
+ VERSION = "0.1.1"
3
+ end
@@ -0,0 +1,18 @@
1
+ require "faraday"
2
+ require "json"
3
+ require_relative "ruby_meta_graph/me"
4
+
5
+ module RubyMetaGraph
6
+ Faraday::NestedParamsEncoder.sort_params = false
7
+ BASE_URL = "https://graph.facebook.com/v16.0/"
8
+
9
+ def connect
10
+ initial = Faraday.new(url: BASE_URL,
11
+ request: {
12
+ params_encoder: Faraday::NestedParamsEncoder
13
+ }
14
+ )
15
+
16
+ return initial
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_meta_graph
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Adham Kurniawan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-07-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.7'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.7.9
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.7'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.7.9
33
+ - !ruby/object:Gem::Dependency
34
+ name: dotenv
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.8'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.8.1
43
+ type: :development
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '2.8'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 2.8.1
53
+ description:
54
+ email: adhamkurniawan29@gmail.com
55
+ executables: []
56
+ extensions: []
57
+ extra_rdoc_files: []
58
+ files:
59
+ - LICENSE
60
+ - README.md
61
+ - lib/ruby_meta_graph.rb
62
+ - lib/ruby_meta_graph/me.rb
63
+ - lib/ruby_meta_graph/version.rb
64
+ homepage: https://rubygemspec.org/gems/ruby_meta_graph
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubygems_version: 3.3.7
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Meta Graph API for Ruby
87
+ test_files: []