Permalink
Browse files

Simplified get request

  • Loading branch information...
josepjaume committed Nov 12, 2010
1 parent a645817 commit 91273916b3615382bf327c88473d10da29fa206a
Showing with 3 additions and 7 deletions.
  1. +1 −1 Gemfile.lock
  2. +2 −6 lib/lastfm/connection.rb
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- lastfm (1.0.1)
+ lastfm (1.0.2)
crack
GEM
View
@@ -33,12 +33,8 @@ def request(resource, method, *args)
args = "?method=#{resource}.#{method}&api_key=#{@key}#{formatted_options}"
url = URI.parse(API_URL + "/" + args)
- req = Net::HTTP::Get.new(url.path + args)
- res = Net::HTTP.start(url.host, url.port) {|http|
- http.request(req)
- }
-
- Crack::JSON.parse(res.body)
+ response = Net::HTTP.get(url)
+ Crack::JSON.parse(response)
end
end
end

0 comments on commit 9127391

Please sign in to comment.