Sha256: e587d227fb71edfff3289c11758f5835a1297dfde6c231308ecb54ba4cb53450

Contents?: true

Size: 814 Bytes

Versions: 7

Compression:

Stored size: 814 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')

$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')

require 'connfu'

require 'examples/provisioning/setup'

ARGV.length < 4 and
(
  puts "Please include as argument the api_key, the channel name to be used, the kind of channel (origin, mentions) and the accounts"
  exit
)

api_key = ARGV.shift
channel_name = ARGV.shift
# should be either origin or mentions
type = ARGV.shift
users = ARGV

application = Connfu::Provisioning::Application.new(api_key, CONNFU_ENDPOINT)

hashtags = ["football", "tennis"]

begin
  puts application.create_twitter_channel(channel_name, {type.to_sym => users, :hashtags => hashtags})
rescue Exception => ex
  puts "There was an error: #{ex.inspect} "
  puts "Exception message: #{ex.backtrace}"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
connfu-client-0.1.6 examples/provisioning/twitter/create.rb
connfu-client-0.1.5 examples/provisioning/twitter/create.rb
connfu-client-0.1.4 examples/provisioning/twitter/create.rb
connfu-client-0.1.3 examples/provisioning/twitter/create.rb
connfu-client-0.1.2 examples/provisioning/twitter/create.rb
connfu-client-0.1.1 examples/provisioning/twitter/create.rb
connfu-client-0.1 examples/provisioning/twitter/create.rb