Sha256: 678a3f2967c46f5d607e350df2032d5ce79294d9040b5f22a5798f1827802df7

Contents?: true

Size: 870 Bytes

Versions: 37

Compression:

Stored size: 870 Bytes

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# require 'twitter'

require_relative 'base_middleware'

module GoodData
  module Bricks
    class TwitterMiddleware < Bricks::Middleware
      def call(params)
        params = params.to_hash
        client = Twitter::REST::Client.new do |config|
          config.consumer_key = params[:twitter_consumer_key]
          config.consumer_secret = params[:twitter_consumer_secret]
          config.access_token = params[:twitter_access_token]
          config.access_token_secret = params[:twitter_access_token_secret]
        end

        returning(@app.call(params)) do |result|
          client.update(result)
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 3 rubygems

Version Path
gooddata-edge-0.6.27.edge lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-bricks-0.8.0 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-bricks-0.7.0 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-bricks-0.6.0 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.49 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.48 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.47 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.46 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.45 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.44 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.43 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.42 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.41 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.40 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.39 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.38 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.37 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.36 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.35 lib/gooddata/bricks/middleware/twitter_middleware.rb
gooddata-0.6.34 lib/gooddata/bricks/middleware/twitter_middleware.rb