fotolia_rails 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fotolia_rails.rb +11 -5
- data/lib/fotolia_rails/version.rb +1 -1
- metadata +1 -1
data/lib/fotolia_rails.rb
CHANGED
@@ -9,11 +9,17 @@ module FotoliaRails
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def search_object(id)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
url = URI.parse("http://#{@api_key}@api.fotolia.com/Rest/1/media/getMediaData?id=#{id}")
|
13
|
+
req = Net::HTTP::Get.new(url.path)
|
14
|
+
res = Net::HTTP.start(url.host, url.port) {|http|
|
15
|
+
http.request(req)
|
16
|
+
}
|
17
|
+
return JSON.parse(res.body)
|
18
|
+
#uri = URI.parse("http://#{@api_key}@api.fotolia.com/Rest/1/media/getMediaData?id=#{id}")
|
19
|
+
#http = Net::HTTP.new(uri.host, uri.port)
|
20
|
+
#request = Net::HTTP::Get.new(uri.request_uri)
|
21
|
+
#response = http.request(request)
|
22
|
+
#return JSON.parse(response.body)
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|