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