itunes-search 0.2.2 → 0.2.3
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.
- data/VERSION +1 -1
- data/itunes-search.gemspec +2 -2
- data/lib/itunes-search/search.rb +10 -1
- metadata +3 -3
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.3
|
data/itunes-search.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{itunes-search}
|
|
8
|
-
s.version = "0.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 = ["jeff durand"]
|
|
12
|
-
s.date = %q{
|
|
12
|
+
s.date = %q{2011-04-21}
|
|
13
13
|
s.description = %q{Pretty simple interface for the itunes search api will return results as array of results objects and offer reasonable accessor methods variables}
|
|
14
14
|
s.email = %q{jeff.durand@gmail.com}
|
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/itunes-search/search.rb
CHANGED
|
@@ -23,11 +23,20 @@ module ItunesSearch
|
|
|
23
23
|
end
|
|
24
24
|
def fetch
|
|
25
25
|
puts "#{ItunesSearch::ENDPOINT}?#{self.options.to_url_params}"
|
|
26
|
-
|
|
26
|
+
uri = URI.parse("#{ItunesSearch::ENDPOINT}?#{self.options.to_url_params}")
|
|
27
|
+
http = Net::HTTP.new(uri.host,uri.port)
|
|
28
|
+
http.open_timeout=5
|
|
29
|
+
http.read_timeout=5
|
|
30
|
+
req = Net::HTTP::Get.new(uri.path)
|
|
31
|
+
resp = http.start do |http|
|
|
32
|
+
http.request(req)
|
|
33
|
+
end
|
|
34
|
+
self.json=resp.body
|
|
27
35
|
end
|
|
28
36
|
def results
|
|
29
37
|
ra = []
|
|
30
38
|
ra = self.to_hash["results"].collect {|r| ItunesSearch::Result.new(r)} unless self.to_hash["results"].empty?
|
|
39
|
+
puts ra.inspect
|
|
31
40
|
return ra
|
|
32
41
|
end
|
|
33
42
|
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 2
|
|
8
|
-
-
|
|
9
|
-
version: 0.2.
|
|
8
|
+
- 3
|
|
9
|
+
version: 0.2.3
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- jeff durand
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date:
|
|
17
|
+
date: 2011-04-21 00:00:00 -04:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|