chunes 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/chunes.rb +18 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0e7e990c1ec4a5be1f8cf2e17caee58309fa6e5b
4
+ data.tar.gz: d4c3b3ebe0f98ea2a727832b9de51634789191ca
5
+ SHA512:
6
+ metadata.gz: 1fff4cf0b924c72f32926bfc6d4d63fff3082f29952233f4c4a0e0a13758ed3060c2c65555f31cfa3f56871fe293d7c27e614aa4025db2d4a02f65c0159b2188
7
+ data.tar.gz: 99cacab5c22a8f153cad529d1c4a7b286fd05b592f9e68e8e5fc2260563f876607fa081578665d3b2e02526c8a7aa68179546ace46c79758828f411fe8e64c45
data/lib/chunes.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'net/http'
2
+ require 'json'
3
+
4
+ class ITunes
5
+ def self.search term
6
+ url = "http://itunes.apple.com/search?term=#{term}"
7
+ get_response url
8
+ end
9
+
10
+ def self.get_response url
11
+ uri = URI(url)
12
+ response = Net::HTTP.get(uri)
13
+ parsed = JSON.parse(response)
14
+ parsed["results"]
15
+ end
16
+
17
+ private_class_method :get_response
18
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chunes
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Damon Tian
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This iTunes Search retrieves Artist Name, Track Name, Album Art, and
14
+ 30 second Song Preview.
15
+ email: damontian@live.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/chunes.rb
21
+ homepage:
22
+ licenses:
23
+ - NYCDA
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.4.6
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: This is my iTunes API Gem.
45
+ test_files: []