ticketfly 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.rdoc +16 -10
  2. data/VERSION +1 -1
  3. data/lib/ticketfly.rb +15 -4
  4. data/ticketfly.gemspec +1 -1
  5. metadata +12 -12
@@ -2,17 +2,23 @@
2
2
 
3
3
  A ruby implementation of the Ticketfly event and venue API.
4
4
 
5
- == Contributing to ticketfly
5
+ == usage
6
+
7
+ * simple consumption
8
+ venues = Ticketfly::Venues.get_all
9
+ events = Ticketfly::Events.get_by_venue_id(venues.third.id)
10
+ artist = events.first.headliners.first
11
+
12
+ * event searching
13
+ events = Ticketfly::Events.search('SEARCH_STRING') <- artist name or city string
14
+ venue = events.first.venue
15
+
16
+ == coming soon
6
17
 
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
18
+ * purchase API
19
+ * artist database
20
+
21
+ == copyright
16
22
 
17
23
  Copyright (c) 2012 Charley Hine. See LICENSE.txt for
18
24
  further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -22,6 +22,10 @@ module Ticketfly
22
22
  venue.json = json
23
23
  venue
24
24
  end
25
+
26
+ def next_event
27
+ Events.get_next_by_venue_id(self.id)
28
+ end
25
29
  end
26
30
 
27
31
  class Headliner
@@ -36,10 +40,9 @@ module Ticketfly
36
40
  end
37
41
 
38
42
  class Event
39
- attr_accessor :id, :name, :venue, :org, :date, :json, :headliners
43
+ attr_accessor :id, :name, :venue, :org, :date, :json
40
44
  def self.build(json)
41
45
  event = Event.new
42
- event.headliners = []
43
46
  event.id = json['id']
44
47
  event.name = json['name']
45
48
  event.json = json
@@ -48,6 +51,14 @@ module Ticketfly
48
51
  event.date = json['startDate']
49
52
  event
50
53
  end
54
+
55
+ def headliners
56
+ headliners = []
57
+ self.json['headliners'].each do |h|
58
+ headliners << Headliner.build(h)
59
+ end
60
+ headliners
61
+ end
51
62
  end
52
63
 
53
64
  class Events
@@ -58,7 +69,7 @@ module Ticketfly
58
69
  Event.build(result['events'].first)
59
70
  end
60
71
 
61
- def self.get_next_event_by_venue_id(venue_id)
72
+ def self.get_next_by_venue_id(venue_id)
62
73
  base_uri = "http://www.ticketfly.com/api/events/upcoming.json"
63
74
  max_results = 1
64
75
  result = JSON.parse(open(base_uri + "?venueId=" + venue_id.to_s).read)
@@ -90,7 +101,7 @@ module Ticketfly
90
101
  total_pages = 1
91
102
  page = 1
92
103
  begin
93
- result = JSON.parse(open(base_uri + "?q=" + query.to_s).read)
104
+ result = JSON.parse(open(base_uri + "?orgId=1&q=" + query.to_s).read)
94
105
  total_pages = result["totalPages"]
95
106
  result['events'].each do |e|
96
107
  event = Event.build(e)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ticketfly"
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Charley Hine"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketfly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70225808293340 !ruby/object:Gem::Requirement
16
+ requirement: &70227900784740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70225808293340
24
+ version_requirements: *70227900784740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: shoulda
27
- requirement: &70225808292180 !ruby/object:Gem::Requirement
27
+ requirement: &70227900784020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70225808292180
35
+ version_requirements: *70227900784020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &70225808289360 !ruby/object:Gem::Requirement
38
+ requirement: &70227900783300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3.12'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70225808289360
46
+ version_requirements: *70227900783300
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &70225808301800 !ruby/object:Gem::Requirement
49
+ requirement: &70227900781940 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70225808301800
57
+ version_requirements: *70227900781940
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &70225808301040 !ruby/object:Gem::Requirement
60
+ requirement: &70227900793740 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 1.8.3
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70225808301040
68
+ version_requirements: *70227900793740
69
69
  description: A ruby implementation of the Ticketfly event and venue API.
70
70
  email: charles.hine@gmail.com
71
71
  executables: []
@@ -100,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  segments:
102
102
  - 0
103
- hash: 4317577769993306950
103
+ hash: -2173984146617654640
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements: