intown 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/intown/client.rb CHANGED
@@ -13,7 +13,7 @@ module Intown
13
13
  def options
14
14
  {
15
15
  :query => {
16
- :app_id => Intown.configuration.app_id, :api_version => API_VERSION
16
+ :app_id => Intown.configuration.app_id, :api_version => API_VERSION, :format => "json"
17
17
  }
18
18
  }
19
19
  end
@@ -57,7 +57,8 @@ module Intown
57
57
 
58
58
  def encode_name(name)
59
59
  # periods & slashes cause the API to blow up
60
- URI.encode(name).gsub(/\./, "%2E").gsub(/\//, "%2F")
60
+ # must double-encode the slash
61
+ URI.encode(name).gsub(/\./, "%2E").gsub(/\//, "%252F")
61
62
  end
62
63
 
63
64
  def musicbrainz_identifier(mbid)
@@ -1,3 +1,3 @@
1
1
  module Intown
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -35,4 +35,42 @@ describe Intown::Artist do
35
35
  end
36
36
  end
37
37
 
38
+ context "with slashes in the name" do
39
+ before do
40
+ Intown.configure {|c| c.app_id = "test"}
41
+ end
42
+
43
+ it "should return nil for unknown artists" do
44
+ VCR.use_cassette("find_unknown_artist_with_slashes") do
45
+ Intown::Artist.fetch(:name => "Fake/Artist/Name").should be_nil
46
+ end
47
+ end
48
+ it "should be fetched by name" do
49
+ VCR.use_cassette("find_artist_by_name_with_slashes") do
50
+ artist = Intown::Artist.fetch(:name => "Be/Non")
51
+ artist.name.should == "Be/Non"
52
+ artist.upcoming_events_count.should_not be_nil
53
+ artist.image_url.should_not be_nil
54
+ artist.mbid.should_not be_nil
55
+ end
56
+ end
57
+ end
58
+
59
+ context "with periods in the name" do
60
+ it "should return nil for unknown artists" do
61
+ VCR.use_cassette("find_unknown_artist_with_periods") do
62
+ Intown::Artist.fetch(:name => "Fake.Artist.Name").should be_nil
63
+ end
64
+ end
65
+ it "should be fetched by name" do
66
+ VCR.use_cassette("find_artist_by_name_with_periods") do
67
+ artist = Intown::Artist.fetch(:name => "will.i.am")
68
+ artist.name.should == "will.i.am"
69
+ artist.upcoming_events_count.should_not be_nil
70
+ artist.image_url.should_not be_nil
71
+ artist.mbid.should_not be_nil
72
+ end
73
+ end
74
+ end
75
+
38
76
  end
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.bandsintown.com/artists/foobar?api_version=2.0&app_id=
5
+ uri: https://api.bandsintown.com/artists/foobar?api_version=2.0&app_id=&format=json
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -13,22 +13,22 @@ http_interactions:
13
13
  message: Not Found
14
14
  headers:
15
15
  Date:
16
- - Thu, 21 Feb 2013 20:11:49 GMT
16
+ - Mon, 22 Apr 2013 22:11:24 GMT
17
17
  Server:
18
18
  - Mongrel 1.1.5
19
19
  Content-Length:
20
20
  - '40'
21
- Content-Type:
22
- - application/json; charset=utf-8
23
- X-Runtime:
24
- - '0.02046'
25
21
  Status:
26
22
  - 404 Not Found
23
+ X-Runtime:
24
+ - '0.00446'
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
27
  Cache-Control:
28
28
  - no-cache
29
29
  Set-Cookie:
30
- - _session_id=04cd7ac85a121e74bfb474f94f04c501; path=/; expires=Thu, 21 Mar
31
- 2013 19:11:49 GMT
30
+ - _session_id=c70e44e8a3cdce094b2fa9afb3c5b4ac; path=/; expires=Wed, 22 May
31
+ 2013 22:11:24 GMT
32
32
  Vary:
33
33
  - Accept-Encoding
34
34
  Connection:
@@ -39,5 +39,5 @@ http_interactions:
39
39
 
40
40
  '
41
41
  http_version:
42
- recorded_at: Thu, 21 Feb 2013 20:11:49 GMT
42
+ recorded_at: Mon, 22 Apr 2013 22:11:27 GMT
43
43
  recorded_with: VCR 2.4.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.bandsintown.com/artists/Blame%20Sally/events?api_version=2.0&app_id=test
5
+ uri: https://api.bandsintown.com/artists/Blame%20Sally/events?api_version=2.0&app_id=test&format=json
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -13,50 +13,79 @@ http_interactions:
13
13
  message: OK
14
14
  headers:
15
15
  Date:
16
- - Thu, 21 Feb 2013 20:15:44 GMT
16
+ - Mon, 22 Apr 2013 22:11:26 GMT
17
17
  Server:
18
18
  - Mongrel 1.1.5
19
- Etag:
20
- - ! '"8f78b9ff373c3291535e34a9c28a2d67"'
21
19
  Content-Length:
22
- - '5768'
23
- Cache-Control:
24
- - private, max-age=0, must-revalidate
20
+ - '6902'
25
21
  X-Runtime:
26
- - '0.06541'
27
- Status:
28
- - 200 OK
22
+ - '0.05485'
29
23
  Content-Type:
30
24
  - application/json; charset=utf-8
25
+ Status:
26
+ - 200 OK
27
+ Etag:
28
+ - ! '"0be1771512632186d38077daa208e023"'
29
+ Cache-Control:
30
+ - private, max-age=0, must-revalidate
31
31
  Set-Cookie:
32
- - _session_id=09b05e580a4b65a836214fc870b5b76b; path=/; expires=Thu, 21 Mar
33
- 2013 19:15:44 GMT
32
+ - _session_id=31277a54fa280474196ef08680150c0b; path=/; expires=Wed, 22 May
33
+ 2013 22:11:26 GMT
34
34
  Vary:
35
35
  - Accept-Encoding
36
36
  Connection:
37
37
  - close
38
38
  body:
39
39
  encoding: US-ASCII
40
- string: ! '[{"ticket_status":"unavailable","ticket_type":null,"ticket_url":null,"formatted_location":"Chico,
41
- CA","formatted_datetime":"Monday, April 15, 2013 at 7:30pm","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6216225\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","artists":[{"mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208","name":"Blame
42
- Sally","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg"}],"facebook_share_url":"https:\/\/www.facebook.com\/dialog\/feed?actions=%7B%22link%22%3A%22http%3A%5C%2F%5C%2Fwww.bandsintown.com%5C%2Fevent%5C%2F6216225%5C%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D78%22%2C%22name%22%3A%22RSVP%22%7D&app_id=123966167614127&caption=Monday%2C+April+15%2C+2013+at+7%3A30pm&description=%26nbsp%3B&link=http%3A%2F%2Fwww.bandsintown.com%2Fevent%2F6216225%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D77&name=Blame+Sally+%40+Sierra+Nevada+Brewing+Co.+in+Chico%2C+CA&picture=https%3A%2F%2Fd12nfv3nknyhzq.cloudfront.net%2FBlameSally%2Fphoto%2Flarge.jpg&properties=%7B%22More+Tour+Dates%22%3A%7B%22text%22%3A%22http%3A%5C%2F%5C%2Fbnds.in%5C%2FIgxMaj%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Fwww.bandsintown.com%5C%2FBlameSally%5C%2Ffacebookapp%3Fcame_from%3D78%22%7D%7D&redirect_uri=http%3A%2F%2Fwww.bandsintown.com%2Fevent%2F6216225%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D102","title":"Blame
43
- Sally @ Sierra Nevada Brewing Co. in Chico, CA","id":"6216225","description":null,"on_sale_datetime":null,"venue":{"country":"United
44
- States","name":"Sierra Nevada Brewing Co.","longitude":"-121.8139110","city":"Chico","region":"CA","latitude":"39.7249330"},"datetime":"2013-04-15T19:30:00"},
40
+ string: ! '[{"venue":{"country":"United States","city":"San Francisco","name":"The
41
+ Chapel","longitude":"-122.4214360","latitude":"37.7605720","region":"CA"},"description":null,"on_sale_datetime":null,"ticket_url":"http:\/\/www.bandsintown.com\/event\/6431919\/buy_tickets?app_id=test&artist=Blame+Sally","formatted_datetime":"Saturday,
42
+ April 27, 2013 at 9:00pm","datetime":"2013-04-27T21:00:00","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6431919\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","ticket_type":"Tickets","facebook_share_url":null,"artists":[{"name":"Blame
43
+ Sally","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208"}],"title":"Blame
44
+ Sally @ The Chapel in San Francisco, CA","id":"6431919","ticket_status":"available","formatted_location":"San
45
+ Francisco, CA"},
46
+
47
+ {"venue":{"country":"United States","city":"Sacramento","name":"Harlow''s
48
+ Restaurant and Nightclub","longitude":"-121.4703840","latitude":"38.5740110","region":"CA"},"description":null,"on_sale_datetime":null,"ticket_url":"http:\/\/www.bandsintown.com\/event\/6347303\/buy_tickets?app_id=test&artist=Blame+Sally","formatted_datetime":"Sunday,
49
+ April 28, 2013 at 7:00pm","datetime":"2013-04-28T19:00:00","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6347303\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","ticket_type":"Tickets","facebook_share_url":null,"artists":[{"name":"Blame
50
+ Sally","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208"}],"title":"Blame
51
+ Sally @ Harlow''s Restaurant and Nightclub in Sacramento, CA","id":"6347303","ticket_status":"available","formatted_location":"Sacramento,
52
+ CA"},
53
+
54
+ {"venue":{"country":"United States","city":"San Francisco","name":"Great American
55
+ Music Hall","longitude":"-122.4205960","latitude":"37.7943790","region":"CA"},"description":null,"on_sale_datetime":null,"ticket_url":"http:\/\/www.bandsintown.com\/event\/5985466\/buy_tickets?app_id=test&artist=Blame+Sally","formatted_datetime":"Saturday,
56
+ May 11, 2013 at 9:00pm","datetime":"2013-05-11T21:00:00","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/5985466\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","ticket_type":"Tickets","facebook_share_url":null,"artists":[{"name":"Blame
57
+ Sally","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208"}],"title":"Blame
58
+ Sally @ Great American Music Hall in San Francisco, CA","id":"5985466","ticket_status":"available","formatted_location":"San
59
+ Francisco, CA"},
60
+
61
+ {"venue":{"country":"United States","city":"San Diego","name":"AMSD Concerts","longitude":"-117.1183320","latitude":"32.7625810","region":"CA"},"description":null,"on_sale_datetime":null,"ticket_url":"http:\/\/www.bandsintown.com\/event\/6476382\/buy_tickets?app_id=test&artist=Blame+Sally","formatted_datetime":"Friday,
62
+ June 7, 2013 at 7:30pm","datetime":"2013-06-07T19:30:00","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6476382\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","ticket_type":"Tickets","facebook_share_url":null,"artists":[{"name":"Blame
63
+ Sally","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208"}],"title":"Blame
64
+ Sally @ AMSD Concerts in San Diego, CA","id":"6476382","ticket_status":"available","formatted_location":"San
65
+ Diego, CA"},
66
+
67
+ {"venue":{"country":"United States","city":"Santa Monica","name":"McCabe''s
68
+ Guitar Shop","longitude":"-118.4574280","latitude":"34.0258410","region":"CA"},"description":null,"on_sale_datetime":null,"ticket_url":null,"formatted_datetime":"Saturday,
69
+ June 8, 2013 at 8:00pm","datetime":"2013-06-08T20:00:00","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6505411\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","ticket_type":null,"facebook_share_url":null,"artists":[{"name":"Blame
70
+ Sally","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208"}],"title":"Blame
71
+ Sally @ McCabe''s Guitar Shop in Santa Monica, CA","id":"6505411","ticket_status":"unavailable","formatted_location":"Santa
72
+ Monica, CA"},
45
73
 
46
- {"ticket_status":"unavailable","ticket_type":null,"ticket_url":null,"formatted_location":"Seattle,
47
- WA","formatted_datetime":"Friday, April 19, 2013 at 9:00pm","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6128697\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","artists":[{"mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208","name":"Blame
48
- Sally","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg"}],"facebook_share_url":"https:\/\/www.facebook.com\/dialog\/feed?actions=%7B%22link%22%3A%22http%3A%5C%2F%5C%2Fwww.bandsintown.com%5C%2Fevent%5C%2F6128697%5C%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D78%22%2C%22name%22%3A%22RSVP%22%7D&app_id=123966167614127&caption=Friday%2C+April+19%2C+2013+at+9%3A00pm&description=%26nbsp%3B&link=http%3A%2F%2Fwww.bandsintown.com%2Fevent%2F6128697%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D77&name=Blame+Sally+%40+The+Triple+Door+in+Seattle%2C+WA&picture=https%3A%2F%2Fd12nfv3nknyhzq.cloudfront.net%2FBlameSally%2Fphoto%2Flarge.jpg&properties=%7B%22More+Tour+Dates%22%3A%7B%22text%22%3A%22http%3A%5C%2F%5C%2Fbnds.in%5C%2FIgxMaj%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Fwww.bandsintown.com%5C%2FBlameSally%5C%2Ffacebookapp%3Fcame_from%3D78%22%7D%7D&redirect_uri=http%3A%2F%2Fwww.bandsintown.com%2Fevent%2F6128697%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D102","title":"Blame
49
- Sally @ The Triple Door in Seattle, WA","id":"6128697","description":null,"on_sale_datetime":null,"venue":{"country":"United
50
- States","name":"The Triple Door","longitude":"-122.3379440","city":"Seattle","region":"WA","latitude":"47.6084330"},"datetime":"2013-04-19T21:00:00"},
74
+ {"venue":{"country":"United States","city":"Santa Barbara","name":"Live Oak
75
+ Music Festival","longitude":"-120.0183270","latitude":"34.5883900","region":"CA"},"description":null,"on_sale_datetime":null,"ticket_url":"http:\/\/www.bandsintown.com\/event\/6443960\/buy_tickets?app_id=test&artist=Blame+Sally","formatted_datetime":"Friday,
76
+ June 14, 2013 at 4:00pm","datetime":"2013-06-14T16:00:00","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6443960\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","ticket_type":"Tickets","facebook_share_url":null,"artists":[{"name":"Blame
77
+ Sally","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208"}],"title":"Blame
78
+ Sally @ Live Oak Music Festival in Santa Barbara, CA","id":"6443960","ticket_status":"available","formatted_location":"Santa
79
+ Barbara, CA"},
51
80
 
52
- {"ticket_status":"available","ticket_type":"Tickets","ticket_url":"http:\/\/www.bandsintown.com\/event\/5985466\/buy_tickets?app_id=test&artist=Blame+Sally","formatted_location":"San
53
- Francisco, CA","formatted_datetime":"Saturday, May 11, 2013 at 9:00pm","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/5985466\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","artists":[{"mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208","name":"Blame
54
- Sally","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg"}],"facebook_share_url":"https:\/\/www.facebook.com\/dialog\/feed?actions=%7B%22link%22%3A%22http%3A%5C%2F%5C%2Fwww.bandsintown.com%5C%2Fevent%5C%2F5985466%5C%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D78%22%2C%22name%22%3A%22RSVP%22%7D&app_id=123966167614127&caption=Saturday%2C+May+11%2C+2013+at+9%3A00pm&description=%26nbsp%3B&link=http%3A%2F%2Fwww.bandsintown.com%2Fevent%2F5985466%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D77&name=Blame+Sally+%40+Great+American+Music+Hall+in+San+Francisco%2C+CA&picture=https%3A%2F%2Fd12nfv3nknyhzq.cloudfront.net%2FBlameSally%2Fphoto%2Flarge.jpg&properties=%7B%22Tickets%22%3A%7B%22text%22%3A%22http%3A%5C%2F%5C%2Fbnds.in%5C%2FUNp0bR%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Fwww.bandsintown.com%5C%2Fevent%5C%2F5985466%5C%2Fbuy_tickets%3Faffil_code%3Dfb_19907696684%26artist%3DBlame%2BSally%22%7D%2C%22More+Tour+Dates%22%3A%7B%22text%22%3A%22http%3A%5C%2F%5C%2Fbnds.in%5C%2FIgxMaj%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Fwww.bandsintown.com%5C%2FBlameSally%5C%2Ffacebookapp%3Fcame_from%3D78%22%7D%7D&redirect_uri=http%3A%2F%2Fwww.bandsintown.com%2Fevent%2F5985466%2Ffacebook_rsvp%3Fartist%3DBlame%2BSally%26came_from%3D102","title":"Blame
55
- Sally @ Great American Music Hall in San Francisco, CA","id":"5985466","description":null,"on_sale_datetime":null,"venue":{"country":"United
56
- States","name":"Great American Music Hall","longitude":"-122.4205960","city":"San
57
- Francisco","region":"CA","latitude":"37.7943790"},"datetime":"2013-05-11T21:00:00"}]
81
+ {"venue":{"country":"United States","city":"Santa Barbara","name":"Live Oak
82
+ Music Festival","longitude":"-120.0183270","latitude":"34.5883900","region":"CA"},"description":null,"on_sale_datetime":null,"ticket_url":"http:\/\/www.bandsintown.com\/event\/6444128\/buy_tickets?app_id=test&artist=Blame+Sally","formatted_datetime":"Saturday,
83
+ June 15, 2013 at 2:45pm","datetime":"2013-06-15T14:45:00","facebook_rsvp_url":"http:\/\/www.bandsintown.com\/event\/6444128\/facebook_rsvp?app_id=test&artist=Blame+Sally&came_from=67","ticket_type":"Tickets","facebook_share_url":null,"artists":[{"name":"Blame
84
+ Sally","thumb_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/HQt8jZ","image_url":"http:\/\/www.bandsintown.com\/BlameSally\/photo\/medium.jpg","mbid":"b30ac2b1-a4fc-45a3-98ff-9087a6a10208"}],"title":"Blame
85
+ Sally @ Live Oak Music Festival in Santa Barbara, CA","id":"6444128","ticket_status":"available","formatted_location":"Santa
86
+ Barbara, CA"}]
58
87
 
59
88
  '
60
89
  http_version:
61
- recorded_at: Thu, 21 Feb 2013 20:15:44 GMT
90
+ recorded_at: Mon, 22 Apr 2013 22:11:29 GMT
62
91
  recorded_with: VCR 2.4.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.bandsintown.com/artists/GoobleGobble124/events?api_version=2.0&app_id=test
5
+ uri: https://api.bandsintown.com/artists/GoobleGobble124/events?api_version=2.0&app_id=test&format=json
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -13,22 +13,22 @@ http_interactions:
13
13
  message: Not Found
14
14
  headers:
15
15
  Date:
16
- - Thu, 21 Feb 2013 20:11:51 GMT
16
+ - Mon, 22 Apr 2013 22:11:26 GMT
17
17
  Server:
18
18
  - Mongrel 1.1.5
19
- Status:
20
- - 404 Not Found
21
19
  Cache-Control:
22
20
  - no-cache
23
- Content-Type:
24
- - application/json; charset=utf-8
25
21
  Content-Length:
26
22
  - '30'
23
+ Status:
24
+ - 404 Not Found
27
25
  X-Runtime:
28
- - '0.00860'
26
+ - '0.01519'
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
29
  Set-Cookie:
30
- - _session_id=5d23778c700fcb71fd14d2061fc20e43; path=/; expires=Thu, 21 Mar
31
- 2013 19:11:51 GMT
30
+ - _session_id=b1dc910ca3481fd35acda31ae5023924; path=/; expires=Wed, 22 May
31
+ 2013 22:11:26 GMT
32
32
  Vary:
33
33
  - Accept-Encoding
34
34
  Connection:
@@ -39,5 +39,5 @@ http_interactions:
39
39
 
40
40
  '
41
41
  http_version:
42
- recorded_at: Thu, 21 Feb 2013 20:11:51 GMT
42
+ recorded_at: Mon, 22 Apr 2013 22:11:29 GMT
43
43
  recorded_with: VCR 2.4.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.bandsintown.com/artists/My%20Morning%20Jacket?api_version=2.0&app_id=test
5
+ uri: https://api.bandsintown.com/artists/My%20Morning%20Jacket?api_version=2.0&app_id=test&format=json
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -13,32 +13,32 @@ http_interactions:
13
13
  message: OK
14
14
  headers:
15
15
  Date:
16
- - Thu, 21 Feb 2013 20:11:50 GMT
16
+ - Mon, 22 Apr 2013 22:11:25 GMT
17
17
  Server:
18
18
  - Mongrel 1.1.5
19
- Etag:
20
- - ! '"f71ae1412f3e37311757d098764b8aad"'
21
19
  Cache-Control:
22
20
  - private, max-age=0, must-revalidate
21
+ X-Runtime:
22
+ - '0.02214'
23
+ Etag:
24
+ - ! '"5e4bd78181166d050303722eb1bf586b"'
25
+ Content-Type:
26
+ - application/json; charset=utf-8
23
27
  Status:
24
28
  - 200 OK
25
- X-Runtime:
26
- - '0.04589'
27
29
  Content-Length:
28
30
  - '310'
29
- Content-Type:
30
- - application/json; charset=utf-8
31
31
  Set-Cookie:
32
- - _session_id=b50f066fa543a15f617acfe11a075bb2; path=/; expires=Thu, 21 Mar
33
- 2013 19:11:50 GMT
32
+ - _session_id=0588678713f51a3ee3c682db6f9d0a08; path=/; expires=Wed, 22 May
33
+ 2013 22:11:25 GMT
34
34
  Vary:
35
35
  - Accept-Encoding
36
36
  Connection:
37
37
  - close
38
38
  body:
39
39
  encoding: US-ASCII
40
- string: ! '{"mbid":"ea5883b7-68ce-48b3-b115-61746ea53b8c","upcoming_events_count":0,"image_url":"http:\/\/www.bandsintown.com\/MyMorningJacket\/photo\/medium.jpg","thumb_url":"http:\/\/www.bandsintown.com\/MyMorningJacket\/photo\/small.jpg","name":"My
41
- Morning Jacket","facebook_tour_dates_url":"http:\/\/bnds.in\/zTPiUu"}'
40
+ string: ! '{"image_url":"http:\/\/www.bandsintown.com\/MyMorningJacket\/photo\/medium.jpg","name":"My
41
+ Morning Jacket","mbid":"ea5883b7-68ce-48b3-b115-61746ea53b8c","thumb_url":"http:\/\/www.bandsintown.com\/MyMorningJacket\/photo\/small.jpg","facebook_tour_dates_url":"http:\/\/bnds.in\/zTPiUu","upcoming_events_count":0}'
42
42
  http_version:
43
- recorded_at: Thu, 21 Feb 2013 20:11:50 GMT
43
+ recorded_at: Mon, 22 Apr 2013 22:11:28 GMT
44
44
  recorded_with: VCR 2.4.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bandsintown.com/artists/will.i.am?api_version=2.0&app_id=test&format=json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Mon, 22 Apr 2013 22:24:00 GMT
17
+ Server:
18
+ - Mongrel 1.1.5
19
+ Content-Type:
20
+ - application/json; charset=utf-8
21
+ X-Runtime:
22
+ - '0.01186'
23
+ Status:
24
+ - 200 OK
25
+ Etag:
26
+ - ! '"549c6124d1ad1958ab50e2ec39f887f6"'
27
+ Cache-Control:
28
+ - private, max-age=0, must-revalidate
29
+ Content-Length:
30
+ - '268'
31
+ Set-Cookie:
32
+ - _session_id=47adc2d2df801da8e72d914fc82ae68d; path=/; expires=Wed, 22 May
33
+ 2013 22:24:00 GMT
34
+ Vary:
35
+ - Accept-Encoding
36
+ Connection:
37
+ - close
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '{"thumb_url":"http:\/\/www.bandsintown.com\/will.i.am\/photo\/small.jpg","facebook_tour_dates_url":null,"name":"will.i.am","upcoming_events_count":2,"mbid":"d574c9bd-46f6-440a-8d6a-8412a283eeb1","image_url":"http:\/\/www.bandsintown.com\/will.i.am\/photo\/medium.jpg"}'
41
+ http_version:
42
+ recorded_at: Mon, 22 Apr 2013 22:24:03 GMT
43
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bandsintown.com/artists/Be%252FNon?api_version=2.0&app_id=test&format=json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Mon, 22 Apr 2013 22:23:59 GMT
17
+ Server:
18
+ - Mongrel 1.1.5
19
+ Status:
20
+ - 200 OK
21
+ Cache-Control:
22
+ - private, max-age=0, must-revalidate
23
+ X-Runtime:
24
+ - '0.01019'
25
+ Content-Length:
26
+ - '268'
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Etag:
30
+ - ! '"bdf1577ae15a7f3b2d7e95c27251691d"'
31
+ Set-Cookie:
32
+ - _session_id=ea8114b3c22b65f23c46ff67b06ef6af; path=/; expires=Wed, 22 May
33
+ 2013 22:23:59 GMT
34
+ Vary:
35
+ - Accept-Encoding
36
+ Connection:
37
+ - close
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '{"facebook_tour_dates_url":null,"thumb_url":"http:\/\/www.bandsintown.com\/Be%252FNon\/photo\/small.jpg","image_url":"http:\/\/www.bandsintown.com\/Be%252FNon\/photo\/medium.jpg","upcoming_events_count":1,"name":"Be\/Non","mbid":"a0abad13-cd8a-4d85-8fd7-eb1e5295411d"}'
41
+ http_version:
42
+ recorded_at: Mon, 22 Apr 2013 22:24:02 GMT
43
+ recorded_with: VCR 2.4.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.bandsintown.com/artists/Ishouldnotexist?api_version=2.0&app_id=test
5
+ uri: https://api.bandsintown.com/artists/Ishouldnotexist?api_version=2.0&app_id=test&format=json
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -13,22 +13,22 @@ http_interactions:
13
13
  message: Not Found
14
14
  headers:
15
15
  Date:
16
- - Thu, 21 Feb 2013 20:11:50 GMT
16
+ - Mon, 22 Apr 2013 22:11:25 GMT
17
17
  Server:
18
18
  - Mongrel 1.1.5
19
+ Cache-Control:
20
+ - no-cache
21
+ Status:
22
+ - 404 Not Found
19
23
  Content-Type:
20
24
  - application/json; charset=utf-8
21
25
  X-Runtime:
22
- - '0.01188'
23
- Status:
24
- - 404 Not Found
25
- Cache-Control:
26
- - no-cache
26
+ - '0.03697'
27
27
  Content-Length:
28
28
  - '30'
29
29
  Set-Cookie:
30
- - _session_id=407c1b0ceec22028ba725603afbe8534; path=/; expires=Thu, 21 Mar
31
- 2013 19:11:50 GMT
30
+ - _session_id=05a53119d9b62fac0cd952eadafbea2f; path=/; expires=Wed, 22 May
31
+ 2013 22:11:25 GMT
32
32
  Vary:
33
33
  - Accept-Encoding
34
34
  Connection:
@@ -39,5 +39,5 @@ http_interactions:
39
39
 
40
40
  '
41
41
  http_version:
42
- recorded_at: Thu, 21 Feb 2013 20:11:50 GMT
42
+ recorded_at: Mon, 22 Apr 2013 22:11:28 GMT
43
43
  recorded_with: VCR 2.4.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bandsintown.com/artists/Fake.Artist.Name?api_version=2.0&app_id=test&format=json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 404
13
+ message: Not Found
14
+ headers:
15
+ Date:
16
+ - Mon, 22 Apr 2013 22:24:00 GMT
17
+ Server:
18
+ - Mongrel 1.1.5
19
+ Cache-Control:
20
+ - no-cache
21
+ Status:
22
+ - 404 Not Found
23
+ X-Runtime:
24
+ - '0.00624'
25
+ Content-Length:
26
+ - '30'
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Set-Cookie:
30
+ - _session_id=2ad38cda300bca0d7b2b5c5c272fb4d2; path=/; expires=Wed, 22 May
31
+ 2013 22:24:00 GMT
32
+ Vary:
33
+ - Accept-Encoding
34
+ Connection:
35
+ - close
36
+ body:
37
+ encoding: US-ASCII
38
+ string: ! '{"errors":["Unknown Artist"]}
39
+
40
+ '
41
+ http_version:
42
+ recorded_at: Mon, 22 Apr 2013 22:24:03 GMT
43
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bandsintown.com/artists/Fake%252FArtist%252FName?api_version=2.0&app_id=test&format=json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 404
13
+ message: Not Found
14
+ headers:
15
+ Date:
16
+ - Mon, 22 Apr 2013 22:23:59 GMT
17
+ Server:
18
+ - Mongrel 1.1.5
19
+ Content-Length:
20
+ - '30'
21
+ Status:
22
+ - 404 Not Found
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Runtime:
26
+ - '0.00478'
27
+ Cache-Control:
28
+ - no-cache
29
+ Set-Cookie:
30
+ - _session_id=c586ad006bbcf633701eda074348bebb; path=/; expires=Wed, 22 May
31
+ 2013 22:23:59 GMT
32
+ Vary:
33
+ - Accept-Encoding
34
+ Connection:
35
+ - close
36
+ body:
37
+ encoding: US-ASCII
38
+ string: ! '{"errors":["Unknown Artist"]}
39
+
40
+ '
41
+ http_version:
42
+ recorded_at: Mon, 22 Apr 2013 22:24:02 GMT
43
+ recorded_with: VCR 2.4.0
@@ -37,8 +37,8 @@ describe Intown::Artist do
37
37
  end
38
38
 
39
39
  context "searching by name with a /" do
40
- it "should encode the slash" do
41
- Intown::Artist.should_receive(:get).with(/\/artists\/Is%2FIs/, anything).and_return(response)
40
+ it "should double encode the slash" do
41
+ Intown::Artist.should_receive(:get).with(/\/artists\/Is%252FIs/, anything).and_return(response)
42
42
  Intown::Artist.fetch(:name => "Is/Is")
43
43
  end
44
44
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: intown
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ben Scheirman
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-06 00:00:00.000000000 Z
12
+ date: 2013-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  prerelease: false
@@ -134,7 +134,11 @@ files:
134
134
  - spec/fixtures/cassettes/fetch_events_for_known_band.yml
135
135
  - spec/fixtures/cassettes/fetch_events_for_unknown_band.yml
136
136
  - spec/fixtures/cassettes/find_artist_by_name.yml
137
+ - spec/fixtures/cassettes/find_artist_by_name_with_periods.yml
138
+ - spec/fixtures/cassettes/find_artist_by_name_with_slashes.yml
137
139
  - spec/fixtures/cassettes/find_unknown_artist.yml
140
+ - spec/fixtures/cassettes/find_unknown_artist_with_periods.yml
141
+ - spec/fixtures/cassettes/find_unknown_artist_with_slashes.yml
138
142
  - spec/intown/artist_spec.rb
139
143
  - spec/intown/configuration_spec.rb
140
144
  - spec/intown/event_spec.rb
@@ -171,7 +175,11 @@ test_files:
171
175
  - spec/fixtures/cassettes/fetch_events_for_known_band.yml
172
176
  - spec/fixtures/cassettes/fetch_events_for_unknown_band.yml
173
177
  - spec/fixtures/cassettes/find_artist_by_name.yml
178
+ - spec/fixtures/cassettes/find_artist_by_name_with_periods.yml
179
+ - spec/fixtures/cassettes/find_artist_by_name_with_slashes.yml
174
180
  - spec/fixtures/cassettes/find_unknown_artist.yml
181
+ - spec/fixtures/cassettes/find_unknown_artist_with_periods.yml
182
+ - spec/fixtures/cassettes/find_unknown_artist_with_slashes.yml
175
183
  - spec/intown/artist_spec.rb
176
184
  - spec/intown/configuration_spec.rb
177
185
  - spec/intown/event_spec.rb