Sha256: 7e57580fb85392e87fcda106a80d2c76ad8e18995c1a8cf7402a3f337e709230

Contents?: true

Size: 700 Bytes

Versions: 2

Compression:

Stored size: 700 Bytes

Contents

module Adminpanel
  module Analytics
    module InstagramAnalytics
      extend ActiveSupport::Concern

      included do
        before_filter :set_instagram_token, only:[:instagram, :instagram_comment]
      end

      def instagram_comment

        response = @instagram_client.create_media_comment params[:id], params[:instagram_text]
        debugger
        redirect_to instagram_analytics_path
      end

    private
      def set_instagram_token
        @instagram_token = Auth.find_by_key 'instagram'

        if !@instagram_token.nil?
          @instagram_client ||= Instagram.client(

            access_token: @instagram_token.value
            )
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adminpanel-2.2.1 app/controllers/concerns/adminpanel/analytics/instagram_analytics.rb
adminpanel-2.2.0 app/controllers/concerns/adminpanel/analytics/instagram_analytics.rb