facegroup 0.4.0 → 0.5.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 +4 -4
- data/.travis.yml +0 -2
- data/lib/facegroup/fb_api.rb +8 -0
- data/lib/facegroup/group.rb +5 -0
- data/lib/facegroup/version.rb +1 -1
- data/spec/facegroup_spec.rb +9 -0
- data/spec/fixtures/cassettes/facebook_api.yml +103 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7404cae36e93687ec2e15e450b1607e1f4f8ad63
|
4
|
+
data.tar.gz: e1887cf067bafa506b5fb0b6544eec2ec0359f2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 824809c4c070ff262264464f4db44086b1c7c028e8472eabcb93b18fea93a6ac903fd65e2698cb60ed251bfecb68a5e7c5e7d188cf735f674420d0ee167df206
|
7
|
+
data.tar.gz: aa8fc368c04a8c5983b6f56f44ae4d82e1729da18f6a8a96a8fc42a45222c288efe6802bb3d7b0d7ae2e4b7ab0d1951e9148c765ba35fcc6eb6a61d58154fc22
|
data/.travis.yml
CHANGED
data/lib/facegroup/fb_api.rb
CHANGED
@@ -55,6 +55,14 @@ module FaceGroup
|
|
55
55
|
JSON.load(response.to_s)
|
56
56
|
end
|
57
57
|
|
58
|
+
def self.newest_group_postings(group_id)
|
59
|
+
feed_response = HTTP.get(
|
60
|
+
fb_resource_url(group_id) + '/feed',
|
61
|
+
params: { access_token: access_token }
|
62
|
+
)
|
63
|
+
JSON.parse(feed_response)['data']
|
64
|
+
end
|
65
|
+
|
58
66
|
private_class_method
|
59
67
|
|
60
68
|
def self.fb_resource_url(id)
|
data/lib/facegroup/group.rb
CHANGED
@@ -17,5 +17,10 @@ module FaceGroup
|
|
17
17
|
group_data = FbApi.group_data(id)
|
18
18
|
group_data.include?('error') ? nil : new(group_data: group_data)
|
19
19
|
end
|
20
|
+
|
21
|
+
def latest_posting_time
|
22
|
+
latest_postings = FbApi.newest_group_postings(id)
|
23
|
+
Time.parse(latest_postings.first['updated_time'])
|
24
|
+
end
|
20
25
|
end
|
21
26
|
end
|
data/lib/facegroup/version.rb
CHANGED
data/spec/facegroup_spec.rb
CHANGED
@@ -53,6 +53,15 @@ describe 'FaceGroup specifications' do
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
describe 'Checking Latest Post Time' do
|
58
|
+
it '(HAPPY) should get the latest posting time from a group feed' do
|
59
|
+
group = FaceGroup::Group.find(id: ENV['FB_GROUP_ID'])
|
60
|
+
latest_time = group.latest_posting_time
|
61
|
+
latest_time.must_be_instance_of Time
|
62
|
+
latest_time.must_be :<, Time.now
|
63
|
+
end
|
64
|
+
end
|
56
65
|
end
|
57
66
|
|
58
67
|
describe 'Finding Posting Information' do
|
@@ -309,4 +309,107 @@ http_interactions:
|
|
309
309
|
exist: _12345","type":"OAuthException","code":803,"fbtrace_id":"BHQskf8Fa0\/"}}'
|
310
310
|
http_version:
|
311
311
|
recorded_at: Fri, 04 Nov 2016 05:50:44 GMT
|
312
|
+
- request:
|
313
|
+
method: get
|
314
|
+
uri: https://graph.facebook.com/150352985174571/feed?access_token=<ACCESS_TOKEN_ESCAPED>
|
315
|
+
body:
|
316
|
+
encoding: US-ASCII
|
317
|
+
string: ''
|
318
|
+
headers:
|
319
|
+
Connection:
|
320
|
+
- close
|
321
|
+
Host:
|
322
|
+
- graph.facebook.com
|
323
|
+
User-Agent:
|
324
|
+
- http.rb/2.1.0
|
325
|
+
response:
|
326
|
+
status:
|
327
|
+
code: 200
|
328
|
+
message: OK
|
329
|
+
headers:
|
330
|
+
Access-Control-Allow-Origin:
|
331
|
+
- "*"
|
332
|
+
Etag:
|
333
|
+
- '"5222f9aefc2d5317c741589917417d7224505a08"'
|
334
|
+
Pragma:
|
335
|
+
- no-cache
|
336
|
+
Cache-Control:
|
337
|
+
- private, no-cache, no-store, must-revalidate
|
338
|
+
Facebook-Api-Version:
|
339
|
+
- v2.6
|
340
|
+
Expires:
|
341
|
+
- Sat, 01 Jan 2000 00:00:00 GMT
|
342
|
+
Content-Type:
|
343
|
+
- text/javascript; charset=UTF-8
|
344
|
+
X-Fb-Trace-Id:
|
345
|
+
- FdQ6Bs4RKK+
|
346
|
+
X-Fb-Rev:
|
347
|
+
- '2711773'
|
348
|
+
Vary:
|
349
|
+
- Accept-Encoding
|
350
|
+
X-Fb-Debug:
|
351
|
+
- DFjTsG+Z6/vy1vEqntYonaM8K+l6Fhl6VxHBgGoPR/LQ/h0ZUS7MXITMBE8wJpufgobiDezynEPd9W3BLJMjGg==
|
352
|
+
Date:
|
353
|
+
- Thu, 01 Dec 2016 04:39:16 GMT
|
354
|
+
Connection:
|
355
|
+
- close
|
356
|
+
body:
|
357
|
+
encoding: UTF-8
|
358
|
+
string: '{"data":[{"message":"About the different methodologies for Software
|
359
|
+
Development...","updated_time":"2016-11-30T16:41:03+0000","id":"150352985174571_542660872610445"},{"message":"The
|
360
|
+
posting about netlify got such good feedback, but also some inquiries about
|
361
|
+
the whats\/whys of static site generators. Here''s an article from a year
|
362
|
+
back describing the sudden growth of SSGs. What''s old is new again.","updated_time":"2016-11-30T01:25:28+0000","id":"150352985174571_542142105995655"},{"message":"If
|
363
|
+
you''ve got statically generated websites (jekyll, hugo, middleman, gulp,
|
364
|
+
etc.), take a look at netlify.com -- I recently switched to using it over
|
365
|
+
Github Pages. It can integrate with any Github repo, run build jobs, deploys
|
366
|
+
in its own CDN, and offers SSL for custom domains using letsencrypt. And its
|
367
|
+
slick as hell! Did I mention open source repos get ''pro'' tier access for
|
368
|
+
free?","updated_time":"2016-11-26T09:05:56+0000","id":"150352985174571_540644899478709"},{"message":"Powershell
|
369
|
+
becomes the official command line of Windows 10! Goodbye CMD.EXE -- you served
|
370
|
+
me well when i first used a machine.","updated_time":"2016-11-26T03:34:53+0000","id":"150352985174571_539363269606872"},{"message":"Well
|
371
|
+
worth the read. And important issue for all young developers to keep in mind
|
372
|
+
as they head out to start their careers.","updated_time":"2016-11-21T04:23:37+0000","id":"150352985174571_537053293171203"},{"message":"GitHub
|
373
|
+
language statistics, as expected, JS is the most, Python is the 2nd most popular
|
374
|
+
language!","updated_time":"2016-11-18T01:37:32+0000","id":"150352985174571_537276853148847"},{"message":"Yay,
|
375
|
+
they''re doing it again!","updated_time":"2016-11-17T19:23:18+0000","id":"150352985174571_536826343193898"},{"message":"Traditional
|
376
|
+
CVs & resumes aren''t always the best way to show off what we as developers
|
377
|
+
build. StackOverflow just released ''Developer Story'' -- an online tool for
|
378
|
+
developers to create a storyline based CV of projects, skills, and more. Try
|
379
|
+
making your own storyline to share with others and hunt for jobs!","updated_time":"2016-11-17T01:21:48+0000","id":"150352985174571_536369326572933"},{"message":"Awesome
|
380
|
+
resource for practicing and TEACHING programming. It''s got a bunch of languages
|
381
|
+
to choose from.","updated_time":"2016-11-16T09:45:05+0000","id":"150352985174571_536560309887168"},{"message":"https:\/\/kubernetesbootcamp.github.io\/kubernetes-bootcamp\/index.html","updated_time":"2016-11-15T19:10:52+0000","id":"150352985174571_536400596569806"},{"message":"https:\/\/engineeringblog.yelp.com\/2016\/01\/dumb-init-an-init-for-docker.html","updated_time":"2016-11-10T17:10:40+0000","id":"150352985174571_534225556787310"},{"message":"We''re
|
382
|
+
doing a crazy amount of collaborative coding in our SOA class this semester
|
383
|
+
using #git and #Github. Got to send out thanks to #GithubEducation for supporting
|
384
|
+
education and research by sending us some #GitHubSwag our way! They shipped
|
385
|
+
us stickers, posters, cheat-sheets and their love for our entire class. :)","updated_time":"2016-11-07T19:48:20+0000","id":"150352985174571_532615416948324"},{"message":"Data
|
386
|
+
Source: http:\/\/gs.statcounter.com\/#desktop+mobile+tablet-comparison-ww-monthly-200812-201610","updated_time":"2016-11-06T17:55:21+0000","id":"150352985174571_532352000307999"},{"message":"Hey
|
387
|
+
I am beginner with Web Services development ! I wanted to know , what security
|
388
|
+
measures we can imply on web services ?","updated_time":"2016-11-06T13:06:33+0000","id":"150352985174571_532123483664184"},{"message":"Hello!\n\nI
|
389
|
+
was wondering if anyone here uses or has experience with Polymer? Would love
|
390
|
+
to hear some opinions about it.","updated_time":"2016-11-06T12:58:41+0000","id":"150352985174571_532160360327163"},{"message":"Great
|
391
|
+
tool to practice version control actions: branching, merging, rebase, and
|
392
|
+
more.","updated_time":"2016-11-06T07:48:18+0000","id":"150352985174571_532050607004805"},{"message":"From
|
393
|
+
the article: \"JSON is not a data format you can rely on blindly [...] edge
|
394
|
+
cases and maliciously crafted payloads can cause bugs, crashes and denial
|
395
|
+
of services, mainly because JSON libraries rely on specifications that have
|
396
|
+
evolved over time and that left many details loosely specified or not specified
|
397
|
+
at all.\" Long story short: it seems XML will never die :D (actually, parsing
|
398
|
+
XML is even worse...)","updated_time":"2016-10-28T02:09:39+0000","id":"150352985174571_527664860776713"},{"message":"Github''s
|
399
|
+
adoption of GraphQL for APIs, over RESTful services, might be the tipping
|
400
|
+
point that makes GraphQL ubiquitous. From what little exposure I have to it
|
401
|
+
(thanks to YenTing and Yen-Nan at Cardinal Blue), it seems we are taking the
|
402
|
+
complexity and burden of APIs away from API consumers, and putting it squarely
|
403
|
+
at the feet of API providers. That means using APIs is about to become significantly
|
404
|
+
easier (albeit more deeply nested) for everyone! But it also means that creating
|
405
|
+
APIs is about to become significantly harder. Read more about the big shift
|
406
|
+
at Github.","updated_time":"2016-10-20T08:29:06+0000","id":"150352985174571_524070464469486"},{"message":"https:\/\/m.facebook.com\/story.php?story_fbid=1098448240203391&id=100001146751327","updated_time":"2016-10-13T18:17:23+0000","id":"150352985174571_521137638096102"},{"updated_time":"2016-10-06T08:39:47+0000","id":"150352985174571_518029841740215"},{"message":"A
|
407
|
+
little quiz to keep you sharp on programming trends.","updated_time":"2016-10-06T06:51:44+0000","id":"150352985174571_517105121832687"},{"updated_time":"2016-10-06T01:18:12+0000","id":"150352985174571_517701838439682"},{"message":"Up
|
408
|
+
and coming languages worth keeping our eyes on. I''m already a huge fan of
|
409
|
+
Crystal and Rust, but the author has convinced me to pay more attention to
|
410
|
+
Kotlin and Elm.","updated_time":"2016-09-22T08:12:35+0000","id":"150352985174571_511894255687107"},{"message":"I
|
411
|
+
can''t even wrap my head around all the new features Github just released:
|
412
|
+
code reviews, kanban boards, and much more.","updated_time":"2016-09-19T09:14:51+0000","id":"150352985174571_509461352597064"},{"message":"http:\/\/vertx.io\/","updated_time":"2016-09-13T20:34:39+0000","id":"150352985174571_508953969314469"}],"paging":{"previous":"https:\/\/graph.facebook.com\/v2.6\/150352985174571\/feed?icon_size=16&since=1480524063&access_token=<ACCESS_TOKEN>&limit=25&__paging_token=enc_AdD28PxnSul8946PmUcvh0fH8ihXcvUXNKxcxZAicawXTTHNirHz8oWDOfJGxYTNE3XT7desrEmqC7bsBFbTpVoJGfjJcyNRCv2vcn8HLZCS4cBAZDZD&__previous=1","next":"https:\/\/graph.facebook.com\/v2.6\/150352985174571\/feed?icon_size=16&access_token=<ACCESS_TOKEN>&limit=25&until=1473798879&__paging_token=enc_AdAqfNQpnjF9gW798CPwhyX1P292NEstwYlz5ZCTHjrqSk5I6kNmTIFKNiz6ZABsSMy7XZAj4950Goaw3DRyRbLascTi1B1DLjq2wKgtgGRUZB3FrAZDZD"}}'
|
413
|
+
http_version:
|
414
|
+
recorded_at: Thu, 01 Dec 2016 04:39:16 GMT
|
312
415
|
recorded_with: VCR 3.0.3
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facegroup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soumya Ray
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|