facegroups 0.3.0 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a38b4a1bbadfc425d517db2431c0e73b420143bb
4
- data.tar.gz: 18e87447ef4f72a2c47908697a6b4884097087ec
3
+ metadata.gz: db1034f601052df3e4bb11f4616b424d0e6b00d1
4
+ data.tar.gz: 7cd6a85a5ba637aee3c2b75c2d687afee80d5d66
5
5
  SHA512:
6
- metadata.gz: e7eea6952145e45fd31dea57565f5874b9d504561508918f226b0e3dc7bc3dd5022c64de9b4a7cd537b191e89db9c808bc108ca19aac51770c8c2f29d209053c
7
- data.tar.gz: 00a60a5254b356db714848976459afe08a97129bf8d6c796a1a3748a3084171febf466b37ced2e5621d8f351fb33e2889f408ee4304a6c57abc81ddc977d8772
6
+ metadata.gz: b0ecd09bbb3178844a194e62a0604e316f3d4598092d569779cb848cdc3828bb0b5424ebc14a5706ee475ea722486f980f278cdc0941183ad7db43c5fe7124da
7
+ data.tar.gz: c685876c07f3f956fa2633527b3f0e6a45b53dbc68cbfeb563142686f3877e32ad0b92c8c3fa550b7b1bb8cd514ece3fe18590752d9d2036cf777a50b6bab3a0
data/.rubocop.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  ---
2
2
  AllCops:
3
- TargetRubyVersion: 2.3
3
+ TargetRubyVersion: 2.3
4
+
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- facegroups (0.3.0)
4
+ facegroups (0.4.0)
5
5
  http (~> 2.0)
6
6
 
7
7
  GEM
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 FaceGroup gem in your code: `require 'facegroups'`
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FaceGroups
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -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
- - EIz8PlH74FI
34
+ - D1HpQxu168B
35
35
  X-Fb-Rev:
36
- - '2702404'
36
+ - '2714680'
37
37
  X-Fb-Debug:
38
- - DZjMLSd0p4z+nNyu+XezdBvSa21+zvek2OxwgFMOf2nRmm4SbQMuAo77Vxgs1mfIr+JTyb6nn6crEVUBEdxQag==
38
+ - ByyQ1oL8PWaUpUEcm5nVrZVqI0R5teotsfKyahK17eLtj4jCMp3ehze5aX5VouywplLMy53vilJT3K4wO1YQ/Q==
39
39
  Date:
40
- - Fri, 25 Nov 2016 06:09:53 GMT
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, 25 Nov 2016 06:09:33 GMT
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
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
+ require 'codeclimate-test-reporter'
3
+ CodeClimate::TestReporter.start
2
4
  require 'simplecov'
3
5
  SimpleCov.start
4
6
 
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.3.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-25 00:00:00.000000000 Z
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,5 +0,0 @@
1
- ---
2
- :client_id: ''
3
- :client_secret: ''
4
- :access_token: ''
5
- :group_id: ''
@@ -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