grabz_it 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -65,7 +65,7 @@ options = {
65
65
  :format => 'png',
66
66
  :delay => 1000
67
67
  }
68
- response = client.take_picture('google', options)
68
+ response = client.take_picture(options)
69
69
 
70
70
  puts response.screenshot_id
71
71
  # => 'Y2F2bmViQGdtYWlsLmNvbQ==-20943258e37c4fc28c4977cd76c40f58'
@@ -114,8 +114,8 @@ module GrabzIt
114
114
  def take_picture(options = {})
115
115
  parse_options(options)
116
116
  action = "takepicture.ashx"
117
- response_body = query_api(action, generate_params)
118
- response = Response.new(response_body)
117
+ res = query_api(action, generate_params)
118
+ response = Response.new(res.body)
119
119
  raise response.message if response.message
120
120
  response
121
121
  end
@@ -158,8 +158,8 @@ module GrabzIt
158
158
  :domain => URI.escape(domain),
159
159
  :sig => sig
160
160
  }
161
- response_body = query_api(action, params)
162
- cookie_jar = CookieJar.new(response_body)
161
+ res = query_api(action, params)
162
+ cookie_jar = CookieJar.new(res.body)
163
163
  raise cookie_jar.message if cookie_jar.message
164
164
  cookie_jar
165
165
  end
@@ -196,8 +196,8 @@ module GrabzIt
196
196
  #
197
197
  def get_picture(screenshot_id)
198
198
  action = "getpicture.ashx"
199
- response = query_api(action, { :id => screenshot_id })
200
- image = Image.new(response)
199
+ res = query_api(action, { :id => screenshot_id })
200
+ image = Image.new(res)
201
201
  image
202
202
  end
203
203
 
@@ -209,7 +209,7 @@ module GrabzIt
209
209
  uri = URI("#{API_BASE_URL}#{action}")
210
210
  uri.query = URI.encode_www_form(params)
211
211
  res = Net::HTTP.get_response(uri)
212
- res.body
212
+ res
213
213
  end
214
214
 
215
215
  # Convert the options into the instance variable values
@@ -8,7 +8,7 @@ module GrabzIt
8
8
  @size = @image_bytes ? @image_bytes.size : 0
9
9
  @content_type = response.header['content-type']
10
10
  rescue => ex
11
- raise "Invalid Response"
11
+ raise "Invalid Response: #{ex.message}"
12
12
  end
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module GrabzIt
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grabz_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: