tickets_now 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,35 @@
1
+ *.gem
2
+ *.rbc
3
+
4
+ /.config
5
+ /coverage/
6
+ /InstalledFiles
7
+ /pkg/
8
+ /spec/reports/
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ ## Specific to RubyMotion:
14
+ .dat*
15
+ .repl_history
16
+ build/
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalisation:
25
+ /.bundle/
26
+ /lib/bundler/man/
27
+
28
+ # for a library or gem, you might want to ignore these files since the code is
29
+ # intended to run in multiple environments; otherwise, check them in:
30
+ # Gemfile.lock
31
+ # .ruby-version
32
+ # .ruby-gemset
33
+
34
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in tickets_now.gemspec
4
+ gemspec
5
+
6
+ gem 'savon', :git => "git@github.com:savonrb/savon.git", :branch => "version3"
7
+ gem 'nokogiri'
8
+ gem 'rails', '~> 3.0.0'
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 aashish
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Aashish Kiran
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # TicketsNow
2
+
3
+ TicketsNow API for soap web-services to pull data from ticketsnow.com
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'tickets_now'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install tickets_now
18
+
19
+ ## Usage
20
+
21
+ ### Initialize
22
+ tn = TicketsNow::API.new
23
+
24
+ To list all available api methods
25
+
26
+ tn.operations
27
+
28
+ To list all the arguments needed for a specific action
29
+
30
+ tn.search_events_body
31
+ => {:SecurityToken=>"string", :EventName=>"string", :EventCategoryID=>"string", :EventTypeID=>"string", :VenueID=>"string", :MarketAreaID=>"string", :PostalCode=>"string", :StartDate=>"string", :NumberOfDays=>"string"}
32
+
33
+ To pull data
34
+
35
+ args = {:SecurityToken=>"string", :EventName=>"string", :EventCategoryID=>"string", :EventTypeID=>"string", :VenueID=>"string", :MarketAreaID=>"string", :PostalCode=>"string", :StartDate=>"string", :NumberOfDays=>"string"}
36
+ tn.search_events(args)
37
+
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,13 @@
1
+ require "tickets_now/version"
2
+ require 'tickets_now/api'
3
+
4
+
5
+ module TicketsNow
6
+ autoload :API, 'tickets_now/api'
7
+ # Your code goes here...
8
+
9
+ end
10
+
11
+ tn = TicketsNow::API.new
12
+ puts tn
13
+
@@ -0,0 +1,32 @@
1
+ require 'savon'
2
+ require 'rails'
3
+
4
+ module TicketsNow
5
+ class API
6
+ wsdl = 'http://ticketsnow.productserve.com/soap.php?wsdl'
7
+ default = {:SecurityToken=>ENV['tickets_now_token']}
8
+ client = Savon.new(wsdl)
9
+ operations = client.operations("GetEIInfo", "GetEIInfoSoap")
10
+
11
+ define_method("operations") do
12
+ client.operations("GetEIInfo", "GetEIInfoSoap").map! {|x| x.underscore}
13
+ end
14
+ operations.each do |action|
15
+ define_method("#{action.underscore}") do |argument = {}|
16
+ o = client.operation("GetEIInfo", "GetEIInfoSoap", action)
17
+ o.body = {"#{action}" => default.merge(argument)}
18
+ res = o.call
19
+ res = res.hash
20
+ res[:envelope][:body]
21
+ end
22
+ end
23
+
24
+ operations.each do |action|
25
+ define_method("#{action.underscore}_body") do
26
+ o = client.operation("GetEIInfo", "GetEIInfoSoap", action)
27
+ o.example_body[action.to_sym]
28
+ end
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,4 @@
1
+ module TicketsNow
2
+ VERSION = "0.0.1"
3
+ end
4
+
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'tickets_now/version'
5
+ require 'tickets_now/api'
6
+
7
+ Gem::Specification.new do |gem|
8
+ gem.name = "tickets_now"
9
+ gem.version = TicketsNow::VERSION
10
+ gem.authors = ["Aashish Kiran"]
11
+ gem.email = ["aashish@affluence.org"]
12
+ gem.description = %q{TicketsNow API built on SOAP to get data}
13
+ gem.summary = %q{TicketsNow API}
14
+ gem.homepage = ""
15
+
16
+ gem.files = `git ls-files`.split($/) << "lib/tickets_now/api.rb"
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tickets_now
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Aashish Kiran
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-05-01 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: TicketsNow API built on SOAP to get data
15
+ email:
16
+ - aashish@affluence.org
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - LICENSE
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - lib/tickets_now.rb
28
+ - lib/tickets_now/api.rb
29
+ - lib/tickets_now/version.rb
30
+ - tickets_now.gemspec
31
+ homepage: ''
32
+ licenses: []
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubyforge_project:
51
+ rubygems_version: 1.8.25
52
+ signing_key:
53
+ specification_version: 3
54
+ summary: TicketsNow API
55
+ test_files: []