echowrap 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. data/.gitignore +22 -0
  2. data/.travis.yml +16 -0
  3. data/Gemfile +13 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +111 -0
  6. data/Rakefile +1 -0
  7. data/echowrap.gemspec +24 -0
  8. data/lib/echowrap/analysis.rb +39 -0
  9. data/lib/echowrap/api/artist.rb +387 -0
  10. data/lib/echowrap/api/oauth.rb +25 -0
  11. data/lib/echowrap/api/playlist.rb +248 -0
  12. data/lib/echowrap/api/sandbox.rb +45 -0
  13. data/lib/echowrap/api/song.rb +111 -0
  14. data/lib/echowrap/api/taste_profile.rb +296 -0
  15. data/lib/echowrap/api/track.rb +64 -0
  16. data/lib/echowrap/api/utils.rb +57 -0
  17. data/lib/echowrap/artist.rb +73 -0
  18. data/lib/echowrap/asset.rb +12 -0
  19. data/lib/echowrap/audio_summary.rb +15 -0
  20. data/lib/echowrap/base.rb +88 -0
  21. data/lib/echowrap/biography.rb +13 -0
  22. data/lib/echowrap/blog.rb +8 -0
  23. data/lib/echowrap/call_list.rb +8 -0
  24. data/lib/echowrap/category_map.rb +8 -0
  25. data/lib/echowrap/client.rb +80 -0
  26. data/lib/echowrap/configurable.rb +84 -0
  27. data/lib/echowrap/default.rb +88 -0
  28. data/lib/echowrap/doc_counts.rb +8 -0
  29. data/lib/echowrap/echonest_id.rb +8 -0
  30. data/lib/echowrap/error/bad_gateway.rb +11 -0
  31. data/lib/echowrap/error/bad_request.rb +10 -0
  32. data/lib/echowrap/error/client_error.rb +35 -0
  33. data/lib/echowrap/error/configuration_error.rb +8 -0
  34. data/lib/echowrap/error/forbidden.rb +10 -0
  35. data/lib/echowrap/error/gateway_timeout.rb +11 -0
  36. data/lib/echowrap/error/internal_server_error.rb +11 -0
  37. data/lib/echowrap/error/not_acceptable.rb +10 -0
  38. data/lib/echowrap/error/not_found.rb +10 -0
  39. data/lib/echowrap/error/server_error.rb +28 -0
  40. data/lib/echowrap/error/service_unavailable.rb +11 -0
  41. data/lib/echowrap/error/too_many_requests.rb +12 -0
  42. data/lib/echowrap/error/unauthorized.rb +10 -0
  43. data/lib/echowrap/error/unprocessable_entity.rb +10 -0
  44. data/lib/echowrap/error.rb +32 -0
  45. data/lib/echowrap/familiarity.rb +8 -0
  46. data/lib/echowrap/feed.rb +14 -0
  47. data/lib/echowrap/foreign_id.rb +10 -0
  48. data/lib/echowrap/genre.rb +8 -0
  49. data/lib/echowrap/hotttnesss.rb +8 -0
  50. data/lib/echowrap/image.rb +15 -0
  51. data/lib/echowrap/item.rb +95 -0
  52. data/lib/echowrap/item_request.rb +8 -0
  53. data/lib/echowrap/keyvalues.rb +8 -0
  54. data/lib/echowrap/license.rb +10 -0
  55. data/lib/echowrap/location.rb +8 -0
  56. data/lib/echowrap/meta.rb +9 -0
  57. data/lib/echowrap/news_article.rb +8 -0
  58. data/lib/echowrap/options.rb +10 -0
  59. data/lib/echowrap/playlist.rb +47 -0
  60. data/lib/echowrap/prediction.rb +7 -0
  61. data/lib/echowrap/rate_limit.rb +47 -0
  62. data/lib/echowrap/reference.rb +8 -0
  63. data/lib/echowrap/request/multipart_with_file.rb +36 -0
  64. data/lib/echowrap/response/parse_json.rb +25 -0
  65. data/lib/echowrap/response/raise_error.rb +31 -0
  66. data/lib/echowrap/review.rb +8 -0
  67. data/lib/echowrap/rule.rb +8 -0
  68. data/lib/echowrap/sandbox.rb +11 -0
  69. data/lib/echowrap/seeds.rb +9 -0
  70. data/lib/echowrap/sequenced_data/bar.rb +4 -0
  71. data/lib/echowrap/sequenced_data/beat.rb +4 -0
  72. data/lib/echowrap/sequenced_data/section.rb +6 -0
  73. data/lib/echowrap/sequenced_data/segment.rb +4 -0
  74. data/lib/echowrap/sequenced_data/tatum.rb +4 -0
  75. data/lib/echowrap/sequenced_data.rb +12 -0
  76. data/lib/echowrap/song.rb +24 -0
  77. data/lib/echowrap/status.rb +12 -0
  78. data/lib/echowrap/taste_profile.rb +28 -0
  79. data/lib/echowrap/term.rb +8 -0
  80. data/lib/echowrap/track.rb +21 -0
  81. data/lib/echowrap/update_info.rb +8 -0
  82. data/lib/echowrap/urls.rb +9 -0
  83. data/lib/echowrap/version.rb +18 -0
  84. data/lib/echowrap/video.rb +7 -0
  85. data/lib/echowrap/years_active.rb +8 -0
  86. data/lib/echowrap.rb +78 -0
  87. data/spec/echonest/api/artist_spec.rb +901 -0
  88. data/spec/echonest/api/oauth_spec.rb +29 -0
  89. data/spec/echonest/api/playlist_spec.rb +274 -0
  90. data/spec/echonest/api/sandbox_spec.rb +67 -0
  91. data/spec/echonest/api/song_spec.rb +326 -0
  92. data/spec/echonest/api/taste_profile_spec.rb +403 -0
  93. data/spec/echonest/api/track_spec.rb +167 -0
  94. data/spec/echonest/base_spec.rb +119 -0
  95. data/spec/echonest/client_spec.rb +174 -0
  96. data/spec/echonest/error_spec.rb +20 -0
  97. data/spec/echonest/rate_limit_spec.rb +76 -0
  98. data/spec/echonest_spec.rb +65 -0
  99. data/spec/fixtures/artist/biographies.json +1 -0
  100. data/spec/fixtures/artist/blogs.json +1 -0
  101. data/spec/fixtures/artist/extract.json +1 -0
  102. data/spec/fixtures/artist/familiarity.json +1 -0
  103. data/spec/fixtures/artist/hotttnesss.json +1 -0
  104. data/spec/fixtures/artist/images.json +1 -0
  105. data/spec/fixtures/artist/list_genres.json +1 -0
  106. data/spec/fixtures/artist/list_terms.json +1 -0
  107. data/spec/fixtures/artist/news.json +1 -0
  108. data/spec/fixtures/artist/profile.json +1 -0
  109. data/spec/fixtures/artist/reviews.json +1 -0
  110. data/spec/fixtures/artist/search.json +1 -0
  111. data/spec/fixtures/artist/similar.json +1 -0
  112. data/spec/fixtures/artist/songs.json +1 -0
  113. data/spec/fixtures/artist/suggest.json +1 -0
  114. data/spec/fixtures/artist/terms.json +1 -0
  115. data/spec/fixtures/artist/top_hottt.json +1 -0
  116. data/spec/fixtures/artist/top_terms.json +1 -0
  117. data/spec/fixtures/artist/twitter.json +1 -0
  118. data/spec/fixtures/artist/urls.json +1 -0
  119. data/spec/fixtures/artist/video.json +1 -0
  120. data/spec/fixtures/billie_jean_fingerprint.txt +1 -0
  121. data/spec/fixtures/billie_jean_query.json +16 -0
  122. data/spec/fixtures/oauth/timestamp.json +1 -0
  123. data/spec/fixtures/playlist/basic.json +1 -0
  124. data/spec/fixtures/playlist/dynamic/create.json +1 -0
  125. data/spec/fixtures/playlist/dynamic/delete.json +1 -0
  126. data/spec/fixtures/playlist/dynamic/feedback.json +1 -0
  127. data/spec/fixtures/playlist/dynamic/info.json +1 -0
  128. data/spec/fixtures/playlist/dynamic/next.json +1 -0
  129. data/spec/fixtures/playlist/dynamic/restart.json +1 -0
  130. data/spec/fixtures/playlist/dynamic/steer.json +1 -0
  131. data/spec/fixtures/playlist/static.json +1 -0
  132. data/spec/fixtures/sandbox/access.json +19 -0
  133. data/spec/fixtures/sandbox/list.json +1 -0
  134. data/spec/fixtures/song/identify.json +19 -0
  135. data/spec/fixtures/song/profile.json +1 -0
  136. data/spec/fixtures/song/search.json +1 -0
  137. data/spec/fixtures/taste_profile/ban.json +9 -0
  138. data/spec/fixtures/taste_profile/create.json +1 -0
  139. data/spec/fixtures/taste_profile/delete.json +11 -0
  140. data/spec/fixtures/taste_profile/favorite.json +9 -0
  141. data/spec/fixtures/taste_profile/feed.json +1 -0
  142. data/spec/fixtures/taste_profile/keyvalues.json +4 -0
  143. data/spec/fixtures/taste_profile/list.json +1 -0
  144. data/spec/fixtures/taste_profile/play.json +9 -0
  145. data/spec/fixtures/taste_profile/predict.json +1 -0
  146. data/spec/fixtures/taste_profile/profile.json +1 -0
  147. data/spec/fixtures/taste_profile/rate.json +9 -0
  148. data/spec/fixtures/taste_profile/read.json +1 -0
  149. data/spec/fixtures/taste_profile/similar.json +14 -0
  150. data/spec/fixtures/taste_profile/skip.json +9 -0
  151. data/spec/fixtures/taste_profile/status.json +2 -0
  152. data/spec/fixtures/taste_profile/update.json +10 -0
  153. data/spec/fixtures/taste_profile/update_request_data.json +4 -0
  154. data/spec/fixtures/technolol-music.mp3 +0 -0
  155. data/spec/fixtures/track/analysis.json +3 -0
  156. data/spec/fixtures/track/profile.json +35 -0
  157. data/spec/fixtures/track/upload.json +21 -0
  158. data/spec/helper.rb +50 -0
  159. metadata +323 -0
@@ -0,0 +1 @@
1
+ {"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"start": 0, "name": "top hot song catalog by ID", "items": [{"song_name": "Intro", "artist_id": "ARNDRBI122BCFCC2E3", "artist_name": "The XX", "last_modified": "2011-07-14T20:15:49", "date_added": "2011-07-14T20:15:49", "foreign_id": "CAJTFEO131216286ED:song:SOALUTK12AB0188AFA", "song_id": "SOALUTK12AB0188AFA", "request": {"item_id": "SOALUTK12AB0188AFA", "song_id": "SOALUTK12AB0188AFA"}}, {"song_name": "Bad Romance", "artist_id": "ARX6TAQ11C8A415850", "artist_name": "Lady Gaga", "last_modified": "2011-07-14T20:15:50", "date_added": "2011-07-14T20:15:50", "foreign_id": "CAJTFEO131216286ED:song:SOAOBBG127D9789749", "song_id": "SOAOBBG127D9789749", "request": {"item_id": "SOAOBBG127D9789749", "song_id": "SOAOBBG127D9789749"}}, {"song_name": "I Bet You Look Good On The Dancefloor", "artist_id": "ARM0P6Z1187FB4D466", "artist_name": "Arctic Monkeys", "last_modified": "2011-07-14T20:15:49", "date_added": "2011-07-14T20:15:49", "foreign_id": "CAJTFEO131216286ED:song:SOAPHFJ12A8151BD5A", "song_id": "SOAPHFJ12A8151BD5A", "request": {"item_id": "SOAPHFJ12A8151BD5A", "song_id": "SOAPHFJ12A8151BD5A"}}, {"song_name": "Smells Like Teen Spirit", "artist_id": "ARH3S5S1187FB4F76B", "artist_name": "Nirvana", "last_modified": "2011-07-14T20:15:49", "date_added": "2011-07-14T20:15:49", "foreign_id": "CAJTFEO131216286ED:song:SOAWRDN12A8C140D30", "song_id": "SOAWRDN12A8C140D30", "request": {"item_id": "SOAWRDN12A8C140D30", "song_id": "SOAWRDN12A8C140D30"}}, {"song_name": "The Cave", "artist_id": "ARJERLY11E2835D7DC", "artist_name": "Mumford and Sons", "artist_hotttnesss": 0.68746099999999999, "last_modified": "2011-07-14T20:15:49", "date_added": "2011-07-14T20:15:49", "foreign_id": "CAJTFEO131216286ED:song:SOAXAAX12A8C1403BC", "song_id": "SOAXAAX12A8C1403BC", "request": {"item_id": "SOAXAAX12A8C1403BC", "song_id": "SOAXAAX12A8C1403BC"}, "audio_summary": {"analysis_url": "http://echonest-analysis.s3.amazonaws.com/TR/mqEMAwT4uPg0S_Z190CMRRbkXUvE_nyrRbYow0/3/full.json?AWSAccessKeyId=AKIAJRDFEY23UEVW42BQ&Expires=1368989633&Signature=RDDuQqLj6TBq4oCtd5ejUvZ733I%3D", "energy": 0.53817264730108372, "tempo": 70.923000000000002, "speechiness": 0.044971945143799819, "key": 4, "duration": 216.50667000000001, "audio_md5": "7799f5d2ef04a7d57619960b7116115d", "liveness": 0.10803060909070099, "acousticness": 0.065305331798498595, "mode": 1, "time_signature": 4, "loudness": -7.6920000000000002, "valence": 0.2561723387190904, "danceability": 0.55016834344152954}}, {"song_name": "Dog Days Are Over", "artist_id": "ARNCHOP121318C56B8", "artist_name": "Florence + The Machine", "last_modified": "2011-07-14T20:15:49", "date_added": "2011-07-14T20:15:49", "foreign_id": "CAJTFEO131216286ED:song:SOAXGDH12A8C13F8A1", "song_id": "SOAXGDH12A8C13F8A1", "request": {"item_id": "SOAXGDH12A8C13F8A1", "song_id": "SOAXGDH12A8C13F8A1"}}, {"song_name": "In Bloom", "artist_id": "ARH3S5S1187FB4F76B", "artist_name": "Nirvana", "last_modified": "2011-07-14T20:15:50", "date_added": "2011-07-14T20:15:50", "foreign_id": "CAJTFEO131216286ED:song:SOBBCOR12A6701E943", "song_id": "SOBBCOR12A6701E943", "request": {"item_id": "SOBBCOR12A6701E943", "song_id": "SOBBCOR12A6701E943"}}, {"song_name": "Poker Face", "artist_id": "ARX6TAQ11C8A415850", "artist_name": "Lady Gaga", "last_modified": "2011-07-14T20:15:49", "date_added": "2011-07-14T20:15:49", "foreign_id": "CAJTFEO131216286ED:song:SOBUQZI127D9786A8A", "song_id": "SOBUQZI127D9786A8A", "request": {"item_id": "SOBUQZI127D9786A8A", "song_id": "SOBUQZI127D9786A8A"}}, {"song_name": "Paradise City", "artist_id": "ARM7EDF1187B9B3FA1", "artist_name": "Guns N' Roses", "last_modified": "2011-07-14T20:15:51", "date_added": "2011-07-14T20:15:51", "foreign_id": "CAJTFEO131216286ED:song:SOCDFIA12AF72A0BFB", "song_id": "SOCDFIA12AF72A0BFB", "request": {"item_id": "SOCDFIA12AF72A0BFB", "song_id": "SOCDFIA12AF72A0BFB"}}, {"song_name": "Fake Tales Of San Francisco", "artist_id": "ARM0P6Z1187FB4D466", "artist_name": "Arctic Monkeys", "artist_hotttnesss": 0.62104700000000002, "last_modified": "2011-07-14T20:15:50", "date_added": "2011-07-14T20:15:50", "foreign_id": "CAJTFEO131216286ED:song:SOCGOZK12A8151BD5D", "song_id": "SOCGOZK12A8151BD5D", "request": {"item_id": "SOCGOZK12A8151BD5D", "song_id": "SOCGOZK12A8151BD5D"}, "audio_summary": {"analysis_url": "http://echonest-analysis.s3.amazonaws.com/TR/7_fe4gz5wWUv-QdYUhAlCVAnmLYf-NIzcSmsZU/3/full.json?AWSAccessKeyId=AKIAJRDFEY23UEVW42BQ&Expires=1368989633&Signature=TqeDhwrHkWVYgsXfQvPLCZ%2BWdas%3D", "energy": 0.78054897063065098, "tempo": 127.14, "speechiness": 0.042717004417133886, "key": 11, "duration": 177.8819, "audio_md5": "ffd5a26dce6aee397b2e8022bc9a1c2b", "liveness": 0.045574745170714887, "acousticness": 0.0039951710640257678, "mode": 0, "time_signature": 4, "loudness": -4.915, "valence": 0.53889782182166279, "danceability": 0.44845163625648349}}, {"song_name": "Basic Space", "artist_id": "ARNDRBI122BCFCC2E3", "artist_name": "The XX", "artist_hotttnesss": 0.68371300000000002, "last_modified": "2011-07-14T20:15:50", "date_added": "2011-07-14T20:15:50", "foreign_id": "CAJTFEO131216286ED:song:SOCXCTS12AC468A380", "song_id": "SOCXCTS12AC468A380", "request": {"item_id": "SOCXCTS12AC468A380", "song_id": "SOCXCTS12AC468A380"}, "audio_summary": {"analysis_url": "http://echonest-analysis.s3.amazonaws.com/TR/PXX5dQ9d9x_1DmegNZDLxPSw_REIslqaeXnmrF/3/full.json?AWSAccessKeyId=AKIAJRDFEY23UEVW42BQ&Expires=1368989633&Signature=lqDO2JnVsa%2BihAZhbEVNWkXvT10%3D", "energy": 0.22712342893393553, "tempo": 115.956, "speechiness": 0.082161342949811589, "key": 4, "duration": 188.59210999999999, "audio_md5": "04733cfce9c8aa681df72b0cb98cd343", "liveness": 0.10039897689334021, "acousticness": 0.054268019631903273, "mode": 1, "time_signature": 4, "loudness": -13.170999999999999, "valence": 0.48362122880084779, "danceability": 0.95672518184333144}}, {"song_name": "Come As You Are", "artist_id": "ARH3S5S1187FB4F76B", "artist_name": "Nirvana", "last_modified": "2011-07-14T20:15:48", "date_added": "2011-07-14T20:15:48", "foreign_id": "CAJTFEO131216286ED:song:SODEOCO12A6701E922", "song_id": "SODEOCO12A6701E922", "request": {"item_id": "SODEOCO12A6701E922", "song_id": "SODEOCO12A6701E922"}}, {"song_name": "Sex On Fire", "artist_id": "ARF2EHS1187B994F4E", "artist_name": "Kings of Leon", "artist_hotttnesss": 0.597885, "last_modified": "2011-07-14T20:15:51", "date_added": "2011-07-14T20:15:51", "foreign_id": "CAJTFEO131216286ED:song:SOEADHV12A8C13F115", "song_id": "SOEADHV12A8C13F115", "request": {"item_id": "SOEADHV12A8C13F115", "song_id": "SOEADHV12A8C13F115"}, "audio_summary": {"analysis_url": "http://echonest-analysis.s3.amazonaws.com/TR/KsmQ8wj5St_gTVR4sn7f7UMgiXIPqSp2ZsYf5W/3/full.json?AWSAccessKeyId=AKIAJRDFEY23UEVW42BQ&Expires=1368989633&Signature=qz/rK1FIXT0w7gvZQhr5FTaCjOQ%3D", "energy": 0.89481660987572587, "tempo": 76.543000000000006, "speechiness": 0.060500110591016676, "key": 2, "duration": 204.55293, "audio_md5": "b22c2e0bd7742307ef8e6de86d201ac6", "liveness": 0.089949664927513495, "acousticness": 0.0042474129281682548, "mode": 1, "time_signature": 4, "loudness": -6.4400000000000004, "valence": 0.37193166446729609, "danceability": 0.54077421097114842}}, {"song_name": "I Gotta Feeling", "artist_id": "ARTDQRC1187FB4EFD4", "artist_name": "The Black Eyed Peas", "last_modified": "2011-07-14T20:15:51", "date_added": "2011-07-14T20:15:51", "foreign_id": "CAJTFEO131216286ED:song:SOEZALM12AB01868FA", "song_id": "SOEZALM12AB01868FA", "request": {"item_id": "SOEZALM12AB01868FA", "song_id": "SOEZALM12AB01868FA"}}, {"song_name": "Firework", "artist_id": "AR0IVTL1187B9AD520", "artist_name": "Katy Perry", "last_modified": "2011-07-14T20:15:48", "date_added": "2011-07-14T20:15:48", "foreign_id": "CAJTFEO131216286ED:song:SOFRQTD12A81C233C0", "song_id": "SOFRQTD12A81C233C0", "request": {"item_id": "SOFRQTD12A81C233C0", "song_id": "SOFRQTD12A81C233C0"}}], "total": 74, "type": "song", "id": "CAJTFEO131216286ED"}}}
@@ -0,0 +1,14 @@
1
+ {"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalogs": [{
2
+ "id": "CAOFUDS12BB066268E",
3
+ "name": "test_artist_catalog",
4
+ "type": "artist",
5
+ "total": 4,
6
+ "score": 0.821
7
+ } ,
8
+ {
9
+ "id": "CAGPXKK12BB06F9DE9",
10
+ "name": "test_song_catalog",
11
+ "type": "song",
12
+ "total": 3,
13
+ "score": 0.721
14
+ }]}}
@@ -0,0 +1,9 @@
1
+ {
2
+ "response": {
3
+ "status": {
4
+ "code": 0,
5
+ "message": "Success",
6
+ "version": 4
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,2 @@
1
+ {"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "total_items": 5, "items_updated": 5, "percent_complete": 100.0, "ticket_status": "complete", "update_info": [{"item_id": "1", "info": "lookup failed"}, {"item_id": "3", "info": "bad value"},{"item_id": "8", "info": "couldn't resolve item"}]}}
2
+
@@ -0,0 +1,10 @@
1
+ {
2
+ "response": {
3
+ "status": {
4
+ "code": 0,
5
+ "message": "Success",
6
+ "version": "4.2"
7
+ },
8
+ "ticket": "d298131d5f189c73bd9a8ff706621443"
9
+ }
10
+ }
@@ -0,0 +1,4 @@
1
+ [{"item": {
2
+ "item_id": "NewCat-SODJXOA1313438FB61",
3
+ "song_id": "SODJXOA1313438FB61"
4
+ }}]
Binary file