facegroups 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/facegroups/attachment.rb +2 -1
- data/lib/facegroups/version.rb +1 -1
- data/spec/facegroups_spec.rb +1 -0
- data/spec/fixtures/cassettes/facebook_api.yml +5 -5
- data/spec/spec_helper.rb +2 -0
- metadata +2 -5
- data/config/credentials.yml.example +0 -5
- data/spec/fixtures/fb_api_results.yml +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db1034f601052df3e4bb11f4616b424d0e6b00d1
|
4
|
+
data.tar.gz: 7cd6a85a5ba637aee3c2b75c2d687afee80d5d66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0ecd09bbb3178844a194e62a0604e316f3d4598092d569779cb848cdc3828bb0b5424ebc14a5706ee475ea722486f980f278cdc0941183ad7db43c5fe7124da
|
7
|
+
data.tar.gz: c685876c07f3f956fa2633527b3f0e6a45b53dbc68cbfeb563142686f3877e32ad0b92c8c3fa550b7b1bb8cd514ece3fe18590752d9d2036cf777a50b6bab3a0
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ Please setup your Facebook developer credentials by creating an app profile on F
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
Require
|
21
|
+
Require FaceGroups gem in your code: `require 'facegroups'`
|
22
22
|
|
23
23
|
Supply your Facebook credentials to our library in one of two ways:
|
24
24
|
- Setup environment variables: `ENV[FB_CLIENT_ID]` and `ENV[FB_CLIENT_SECRET]`
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module FaceGroups
|
4
4
|
# Attached URL to Posting
|
5
5
|
class Attachment
|
6
|
-
attr_reader :title, :description, :url
|
6
|
+
attr_reader :title, :description, :url, :media_url
|
7
7
|
|
8
8
|
def initialize(data)
|
9
9
|
return unless data
|
@@ -11,6 +11,7 @@ module FaceGroups
|
|
11
11
|
@title = attachment_data['title']
|
12
12
|
@description = attachment_data['description']
|
13
13
|
@url = attachment_data['url']
|
14
|
+
@media_url = attachment_data&.[]('media')&.[]('image')&.[]('src')
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
data/lib/facegroups/version.rb
CHANGED
data/spec/facegroups_spec.rb
CHANGED
@@ -70,6 +70,7 @@ describe 'Finding Posting Information' do
|
|
70
70
|
retrieved.attachment.wont_be_nil
|
71
71
|
retrieved.attachment.description.must_equal attachment['description']
|
72
72
|
retrieved.attachment.url.must_match 'tutorialzine'
|
73
|
+
retrieved.attachment.media_url.must_match 'https://'
|
73
74
|
end
|
74
75
|
|
75
76
|
it '(SAD) should return nil if Posting ID is invalid' do
|
@@ -31,13 +31,13 @@ http_interactions:
|
|
31
31
|
Content-Type:
|
32
32
|
- application/json; charset=UTF-8
|
33
33
|
X-Fb-Trace-Id:
|
34
|
-
-
|
34
|
+
- D1HpQxu168B
|
35
35
|
X-Fb-Rev:
|
36
|
-
- '
|
36
|
+
- '2714680'
|
37
37
|
X-Fb-Debug:
|
38
|
-
-
|
38
|
+
- ByyQ1oL8PWaUpUEcm5nVrZVqI0R5teotsfKyahK17eLtj4jCMp3ehze5aX5VouywplLMy53vilJT3K4wO1YQ/Q==
|
39
39
|
Date:
|
40
|
-
- Fri,
|
40
|
+
- Fri, 02 Dec 2016 05:54:34 GMT
|
41
41
|
Connection:
|
42
42
|
- close
|
43
43
|
Content-Length:
|
@@ -46,5 +46,5 @@ http_interactions:
|
|
46
46
|
encoding: UTF-8
|
47
47
|
string: '{"access_token":"<ACCESS_TOKEN>","token_type":"bearer"}'
|
48
48
|
http_version:
|
49
|
-
recorded_at: Fri,
|
49
|
+
recorded_at: Fri, 02 Dec 2016 05:54:33 GMT
|
50
50
|
recorded_with: VCR 3.0.3
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facegroups
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aditya Utama Wijaya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -182,7 +182,6 @@ files:
|
|
182
182
|
- README.md
|
183
183
|
- Rakefile
|
184
184
|
- bin/facegroups
|
185
|
-
- config/credentials.yml.example
|
186
185
|
- facegroups.gemspec
|
187
186
|
- lib/facegroups.rb
|
188
187
|
- lib/facegroups/attachment.rb
|
@@ -194,7 +193,6 @@ files:
|
|
194
193
|
- lib/facegroups/version.rb
|
195
194
|
- spec/facegroups_spec.rb
|
196
195
|
- spec/fixtures/cassettes/facebook_api.yml
|
197
|
-
- spec/fixtures/fb_api_results.yml
|
198
196
|
- spec/spec_helper.rb
|
199
197
|
homepage: https://github.com/aditya-utama-wijaya/facegroups
|
200
198
|
licenses:
|
@@ -223,5 +221,4 @@ summary: Gets posted content from public Facebook groups
|
|
223
221
|
test_files:
|
224
222
|
- spec/facegroups_spec.rb
|
225
223
|
- spec/fixtures/cassettes/facebook_api.yml
|
226
|
-
- spec/fixtures/fb_api_results.yml
|
227
224
|
- spec/spec_helper.rb
|
@@ -1,22 +0,0 @@
|
|
1
|
-
---
|
2
|
-
group:
|
3
|
-
name: Web Service Development @ NTHU
|
4
|
-
privacy: OPEN
|
5
|
-
id: '150352985174571'
|
6
|
-
posting:
|
7
|
-
created_time: '2016-10-04T02:21:25+0000'
|
8
|
-
message: A little quiz to keep you sharp on programming trends.
|
9
|
-
id: '150352985174571_517105121832687'
|
10
|
-
attachment:
|
11
|
-
- description: Can you tell Java from JavaScript? Awesome! So you are ready to take
|
12
|
-
our ultimate programming challenge.
|
13
|
-
media:
|
14
|
-
image:
|
15
|
-
height: 490
|
16
|
-
src: https://external.xx.fbcdn.net/safe_image.php?d=AQB9saA-D40lNQqm&w=720&h=720&url=http%3A%2F%2Fcdn.tutorialzine.com%2Fwp-content%2Fuploads%2F2014%2F06%2Fguess-the-programming-language.jpg&cfs=1
|
17
|
-
width: 490
|
18
|
-
target:
|
19
|
-
url: http://www.facebook.com/l.php?u=http%3A%2F%2Ftutorialzine.com%2F2014%2F06%2Fguess-the-programming-language%2F&h=QAQFRGe1e&s=1&enc=AZN6y8VgJr9Ergk1McHtlVvCVfRfamxABJTgHWIsRMn-ol4YYMfoBf6AltqD5KJN4lP86EnrEGKSz-Ef6ROz3Lww
|
20
|
-
title: Guess the Programming Language | Tutorialzine
|
21
|
-
type: share
|
22
|
-
url: http://www.facebook.com/l.php?u=http%3A%2F%2Ftutorialzine.com%2F2014%2F06%2Fguess-the-programming-language%2F&h=QAQFRGe1e&s=1&enc=AZN6y8VgJr9Ergk1McHtlVvCVfRfamxABJTgHWIsRMn-ol4YYMfoBf6AltqD5KJN4lP86EnrEGKSz-Ef6ROz3Lww
|