Sha256: 4e9c77e952196b9e27abe83c06eb9b4509f606755b0df194fd532637576f3eb6

Contents?: true

Size: 1.05 KB

Versions: 23

Compression:

Stored size: 1.05 KB

Contents

module Tags::SocialFeedTags
  include TrustyCms::Taggable

  desc %{Instagram posts feed

        *Usage:*
<pre><code><r:instagram_posts tag="culturaltrust">/code></pre>}
  tag "instagram_posts" do |tag|
    posts = Rails.cache.fetch("instagram_posts/#{tag.attr['tag']}", expires_in: 5.minutes) do
      InstagramFeedService.new.get_feed_for_tag(tag.attr['tag'])
    end
    request.env["action_controller.instance"].render_to_string :partial => "social/instagram_posts",
                                                               :locals => {:posts => posts}

  end

  desc %{Twitter posts feed

        *Usage:*
<pre><code><r:twitter_posts tag="culturaltrust">/code></pre>}
  tag "twitter_posts" do |tag|
    posts = Rails.cache.fetch("twitter_posts/#{tag.attr['tag']}", expires_in: 5.minutes) do
      TwitterFeedService.new.get_feed_for_tag(tag.attr['tag'])
    end
    request.env["action_controller.instance"].render_to_string :partial => "social/twitter_posts",
                                                               :locals => {:posts => posts}

  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.5.3 lib/tags/social_feed_tags.rb
trusty-festivity-extension-2.5.2 lib/tags/social_feed_tags.rb
trusty-festivity-extension-2.5.1 lib/tags/social_feed_tags.rb