social_rails 2.1.1 → 2.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eaca17a99cbd1763331bfb09b21e84548590e3d
|
4
|
+
data.tar.gz: 4296fc279955ccfcb4f7c82c681026bb550b792c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fab702d002ca2b88f557d856d6c76c32f68eaf5f80b58069bc0d7f7ca052404195547d2f77f03d8f73943cfbd6b9092fa0e4e7ec154a6a858b0c6ead7d742503
|
7
|
+
data.tar.gz: 1628bec42e661f3bf349515bd141a60126f40e9ceff37046ef5932ea0ede007074c4d9fb45250a73e470d0816812f78a1702bc21ee33daf5c89da09d0fd4f498
|
@@ -1,5 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require_dependency "social_rails/application_controller"
|
2
|
+
|
3
|
+
module SocialRails
|
4
|
+
class SocialController < ApplicationController
|
5
|
+
def latest
|
6
|
+
render ["social_rails", params[:template], "latest"].compact.join("/"), layout: false
|
7
|
+
end
|
4
8
|
end
|
5
|
-
end
|
9
|
+
end
|
@@ -24,17 +24,21 @@ module SocialRails
|
|
24
24
|
client = Koala::Facebook::API.new(oAuth.get_app_access_token)
|
25
25
|
|
26
26
|
feed = client.get_connection(self.config.page_name, 'posts', {fields: ['link', 'message', 'full_picture'] })
|
27
|
-
self.find_posts(feed)
|
27
|
+
posts = self.find_posts(feed)
|
28
|
+
return posts
|
28
29
|
end
|
29
30
|
|
30
31
|
# Loop through Facebook feed to find posts with message
|
31
32
|
def self.find_posts feed
|
32
33
|
items = []
|
33
|
-
feed.
|
34
|
-
|
35
|
-
|
34
|
+
while items.count < self.config.public[:post_count] || feed.size == 0
|
35
|
+
feed.each do |item|
|
36
|
+
items.push(item) if item.has_key?("message")
|
37
|
+
return items if items.count == self.config.public[:post_count]
|
38
|
+
end
|
39
|
+
feed = feed.next_page
|
36
40
|
end
|
37
|
-
|
41
|
+
return items
|
38
42
|
end
|
39
43
|
|
40
44
|
end
|
data/lib/social_rails/engine.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
+
require 'social_rails/helpers/helper_methods'
|
2
|
+
|
1
3
|
module SocialRails
|
2
4
|
class Engine < ::Rails::Engine
|
3
5
|
isolate_namespace SocialRails
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
+
initializer :add_to_precompile do |app|
|
8
|
+
app.config.assets.precompile += %w( social_rails/social-rails.js )
|
9
|
+
end
|
10
|
+
|
11
|
+
initializer :include_view_helpers do
|
7
12
|
ActionView::Base.send :include, SocialRails::Helpers::HelperMethods
|
8
13
|
end
|
9
14
|
end
|
data/lib/social_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francis G
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- app/assets/javascripts/app.js
|
88
88
|
- app/assets/javascripts/social_rails/social-rails.js
|
89
89
|
- app/assets/stylesheets/social_rails/application.css
|
90
|
+
- app/controllers/social_rails/application_controller.rb
|
90
91
|
- app/controllers/social_rails/social_controller.rb
|
91
92
|
- app/views/social_rails/facebook/_description.html.erb
|
92
93
|
- app/views/social_rails/facebook/_full_picture.html.erb
|
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
138
|
version: '0'
|
138
139
|
requirements: []
|
139
140
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.6.14
|
141
142
|
signing_key:
|
142
143
|
specification_version: 4
|
143
144
|
summary: Ease the pain of integrating social media posts in a Rails app.
|