Sha256: c56de92da063c79741f1129c0d4ccfb70c9b2d4518471cec0bca6fa237852dbd

Contents?: true

Size: 982 Bytes

Versions: 8

Compression:

Stored size: 982 Bytes

Contents

# This script lists Push subscription in your account.
#
# NB: Most of the error handling (exception catching) has been removed for
# the sake of simplicity. Nearly everything in this library may throw
# exceptions, and production code should catch them. See the documentation
# for full details.
#

# Include the shared Env class
require File.dirname(__FILE__) + '/env'

# Create the env object. This reads the command line arguments, creates the
# user object, and provides access to both along with helper functions.
env = Env.new()

begin
	subscriptions = env.user.listPushSubscriptions()

	if subscriptions['subscriptions'].size() == 0
		puts 'No Push subscriptions exist in your account.'
	else
		for subscription in subscriptions['subscriptions']
			env.displaySubscriptionDetails(subscription)
		end
	end

	puts 'Rate limit remainining: ' + String(env.user.rate_limit_remaining)
rescue DataSift::DataSiftError => err
	puts 'ERR: [' + err.class.name + '] ' + err.message
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
datasift-2.1.1 examples/push/list.rb
datasift-2.1.0 examples/push/list.rb
datasift-2.1.0.beta examples/push/list.rb
datasift-2.0.4 examples/push/list.rb
datasift-2.0.3 examples/push/list.rb
datasift-2.0.2 examples/push/list.rb
datasift-2.0.1 examples/push/list.rb
datasift-2.0.0 examples/push/list.rb