seat_geek 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7920da17b9bdc745f4048906075346968fc7eb9
4
- data.tar.gz: d961bfa7d6b3528cade24cdaf9d9d7dbacf3a489
3
+ metadata.gz: 1f2e2a0eff442fb4e1cdd7bf9bca93e0f6372bc1
4
+ data.tar.gz: de2a4cd0093292f2c056255336dd674e3163bed0
5
5
  SHA512:
6
- metadata.gz: 45c96371a72e63c2f62952567ccdbb556514708d6250dcae85afdfe95b14077933b1ec2451a1be5227709146cb93f8071ddbb82392eadd077891b3ad5a6735ef
7
- data.tar.gz: 8a9fc7f025cc3995c57d4c06be72eab725d3e7f16c951bb93b88dd0533057fefe323828189dc8aae2e17fa64c0c9d1ff50b3af50cca1b69a62c7d8089fec090c
6
+ metadata.gz: 04a81267b2fdf4c66a37dcf14c7cd23fa307b780cb64ea44eae952933aeadc40bc337a393e6fe1e4d18981449f00913dc067f056668d867df066235658ee8b84
7
+ data.tar.gz: edae3c7a21842412f2cce83fdfbb2d8008f014299187aa434d0e8a2245882654e8d4cc4f2aa36a4448fa576d300969e44966a5fd6ec3b056124eabee2071b510
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # SeatGeek
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/seat_geek`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Uses the SeatGeek Platform API to data around tickets in the USA.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,24 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+
24
+ Taxonomies
25
+
26
+ ```ruby
27
+ SeatGeek.get_taxonomies
28
+ # => GET http://api.seatgeek.com/2/taxonomies
29
+ ```
30
+ Events (accepts five parameters or none)
31
+ ```ruby
32
+ SeatGeek.get_events()
33
+ # => GET http://api.seatgeek.com/2/events
34
+
35
+ SeatGeek.get_events(month_of_the_year: '2016-03',
36
+ state: 'ny',
37
+ attendee_count: num,
38
+ event_type: 'taxonomie',
39
+ seat_geek_partner_id:)
40
+ ```
26
41
 
27
42
  ## Development
28
43
 
@@ -32,8 +47,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
47
 
33
48
  ## Contributing
34
49
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/seat_geek. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
50
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jmoon/seat_geek. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
51
 
52
+ please write tests with each pull request
37
53
 
38
54
  ## License
39
55
 
@@ -1,6 +1,5 @@
1
1
  module SeatGeek
2
2
  class BuildQuery
3
-
4
3
  def self.build(options)
5
4
  query = ""
6
5
  if options[:month_of_the_year]
@@ -29,7 +28,7 @@ module SeatGeek
29
28
  first_day_of_month = Date.civil(year, month, 1).strftime('%F')
30
29
  last_day_of_month = Date.civil(year, month, -1).strftime('%F')
31
30
 
32
- "&datetime_utc.gte=#{first_day_of_month}&datetime_utc.lte=#{last_day_of_month}"
31
+ "?datetime_utc.gte=#{first_day_of_month}&datetime_utc.lte=#{last_day_of_month}"
33
32
  end
34
33
 
35
34
  # Events in NY state
@@ -0,0 +1,65 @@
1
+ # require "seat_geek/build_query"
2
+ # require 'typhoeus'
3
+ # require 'oj'
4
+
5
+ module SeatGeek
6
+ class Taxonomy
7
+ PUBLIC_API_URL = 'http://api.seatgeek.com/2/taxonomies'
8
+ def initialize()
9
+ end
10
+
11
+ def all
12
+ @base_url = PUBLIC_API_URL
13
+ parse_response(typhoeus_request.body)
14
+ end
15
+
16
+ def professional_sports
17
+ professional = []
18
+ profSports = [2,6,9,15,19,33,37]
19
+ result = SeatGeek::Taxonomy.new.all
20
+
21
+ profSports.each do |x|
22
+ professional << result[x]
23
+ end
24
+
25
+ professional
26
+ end
27
+
28
+ def concerts
29
+ #TODO finish code
30
+ end
31
+
32
+ def minor_sports
33
+ #TODO finish code
34
+ end
35
+
36
+ private
37
+
38
+ attr_accessor :base_url
39
+
40
+ def build_url
41
+ BuildQuery.build(options)
42
+ end
43
+
44
+ def typhoeus_request
45
+ request = Typhoeus::Request.new(build_url,
46
+ method: :get,
47
+ headers: { Accept: "json" }
48
+ ).run
49
+ end
50
+
51
+ def parse_response(json_string)
52
+ Oj.load(json_string)
53
+ end
54
+
55
+ def options
56
+ {
57
+ base_url: base_url,
58
+ # month_of_the_year: month_of_the_year,
59
+ # state: state,
60
+ # attendee_count: attendee_count,
61
+ # event_type: event_type,
62
+ }
63
+ end
64
+ end
65
+ end
@@ -1,3 +1,3 @@
1
1
  module SeatGeek
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/seat_geek.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "seat_geek/version"
2
2
  require "seat_geek/build_query"
3
+ require "seat_geek/taxonomy"
3
4
  require 'typhoeus'
4
5
  require 'oj'
5
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seat_geek
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Moon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2015-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -115,7 +115,6 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".byebug_history"
119
118
  - ".gitignore"
120
119
  - ".travis.yml"
121
120
  - CODE_OF_CONDUCT.md
@@ -132,6 +131,7 @@ files:
132
131
  - lib/seat_geek/models/event_type.rb
133
132
  - lib/seat_geek/models/month_and_year.rb
134
133
  - lib/seat_geek/models/state.rb
134
+ - lib/seat_geek/taxonomy.rb
135
135
  - lib/seat_geek/version.rb
136
136
  - seat_geek.gemspec
137
137
  homepage: https://github.com/jmoon90/seat_geek
data/.byebug_history DELETED
@@ -1,6 +0,0 @@
1
- exit
2
- month_query(month_of_the_year)
3
- n
4
- options[:month_of_the_year]
5
- c
6
- options[:month_of_the_year]