imasquerade 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/imasquerade.gemspec +1 -1
- data/lib/imasquerade/extractor.rb +5 -3
- data/lib/version.rb +1 -1
- metadata +3 -3
data/imasquerade.gemspec
CHANGED
@@ -16,17 +16,19 @@ module Imasquerade
|
|
16
16
|
|
17
17
|
def Extractor.fetch_and_parse_feed_from_apple(id)
|
18
18
|
uri = "http://itunes.apple.com/podcast/id#{id}"
|
19
|
-
response = Curl::Easy.perform(uri) do |curl|
|
20
|
-
curl.headers["User-Agent"] = 'iTunes/10.1.1'
|
21
|
-
end
|
22
19
|
# In case there is some sort of error
|
23
20
|
begin
|
21
|
+
response = Curl::Easy.perform(uri) do |curl|
|
22
|
+
curl.headers["User-Agent"] = 'iTunes/10.1.1'
|
23
|
+
end
|
24
24
|
reader = Nokogiri::XML(response.body_str)
|
25
25
|
array_of_feeds = reader.xpath('//xmlns:key[text()="feedURL"]/following-sibling::xmlns:string[1]/text()')
|
26
26
|
return array_of_feeds[0].to_s
|
27
27
|
rescue Nokogiri::XML::SyntaxError => e
|
28
28
|
puts "Caught exception: #{e}"
|
29
29
|
return ""
|
30
|
+
rescue Curl::Err::HostResolutionError => e
|
31
|
+
puts "Caught exception: #{e}"
|
30
32
|
end
|
31
33
|
end
|
32
34
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ryan Lovelett
|
@@ -168,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
168
|
requirements:
|
169
169
|
- - ">="
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
hash:
|
171
|
+
hash: 1752020548328588146
|
172
172
|
segments:
|
173
173
|
- 0
|
174
174
|
version: "0"
|