grabzit 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/grabzitclient.rb +5 -5
  2. metadata +3 -3
data/lib/grabzitclient.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'digest/md5'
2
2
  require 'net/http'
3
3
  require 'rexml/document'
4
- require 'uri'
4
+ require 'cgi'
5
5
  require File.join(File.dirname(__FILE__), 'screenshotstatus')
6
6
  require File.join(File.dirname(__FILE__), 'grabzitcookie')
7
7
 
@@ -34,7 +34,7 @@ class GrabzItClient
34
34
  #This function returns the unique identifier of the screenshot. This can be used to get the screenshot with the GetPicture method.
35
35
  #
36
36
  def take_picture(url, callback = nil, customId = nil, browserWidth = nil, browserHeight = nil, width = nil, height = nil, format = nil, delay = nil, targetElement = nil)
37
- qs = "key=" + URI.escape(@applicationKey) + "&url=" + URI.escape(url) + "&width=" + nil_check(width) + "&height=" + nil_check(height) + "&format=" + nil_check(format) + "&bwidth=" + nil_check(browserWidth) + "&bheight=" + nil_check(browserHeight) + "&callback=" + URI.escape(nil_check(callback)) + "&customid=" + URI.escape(nil_check(customId)) + "&delay=" + nil_check(delay) + "&target=" + URI.escape(nil_check(targetElement))
37
+ qs = "key=" + CGI.escape(@applicationKey) + "&url=" + CGI.escape(url) + "&width=" + nil_check(width) + "&height=" + nil_check(height) + "&format=" + nil_check(format) + "&bwidth=" + nil_check(browserWidth) + "&bheight=" + nil_check(browserHeight) + "&callback=" + CGI.escape(nil_check(callback)) + "&customid=" + CGI.escape(nil_check(customId)) + "&delay=" + nil_check(delay) + "&target=" + CGI.escape(nil_check(targetElement))
38
38
  sig = Digest::MD5.hexdigest(@applicationSecret+"|"+url+"|"+nil_check(callback)+"|"+nil_check(format)+"|"+nil_check(height)+"|"+nil_check(width)+"|"+nil_check(browserHeight)+"|"+nil_check(browserWidth)+"|"+nil_check(customId)+"|"+nil_check(delay)+"|"+nil_check(targetElement))
39
39
  qs = qs + "&sig=" + sig
40
40
 
@@ -150,7 +150,7 @@ class GrabzItClient
150
150
  def get_cookies(domain)
151
151
  sig = Digest::MD5.hexdigest(@applicationSecret+"|"+domain)
152
152
 
153
- qs = "key=" +URI.escape(@applicationKey)+"&domain="+URI.escape(domain)+"&sig="+sig
153
+ qs = "key=" +CGI.escape(@applicationKey)+"&domain="+CGI.escape(domain)+"&sig="+sig
154
154
 
155
155
  result = get(WebServicesBaseURL + "getcookies.ashx?" + qs)
156
156
 
@@ -201,7 +201,7 @@ class GrabzItClient
201
201
  def set_cookie(name, domain, value = "", path = "/", httponly = false, expires = "")
202
202
  sig = Digest::MD5.hexdigest(@applicationSecret+"|"+name+"|"+domain+"|"+nil_check(value)+"|"+nil_check(path)+"|"+b_to_int(httponly).to_s+"|"+nil_check(expires)+"|0")
203
203
 
204
- qs = "key=" +URI.escape(@applicationKey)+"&domain="+URI.escape(domain)+"&name="+URI.escape(name)+"&value="+URI.escape(nil_check(value))+"&path="+URI.escape(nil_check(path))+"&httponly="+b_to_int(httponly).to_s+"&expires="+nil_check(expires)+"&sig="+sig
204
+ qs = "key=" +CGI.escape(@applicationKey)+"&domain="+CGI.escape(domain)+"&name="+CGI.escape(name)+"&value="+CGI.escape(nil_check(value))+"&path="+CGI.escape(nil_check(path))+"&httponly="+b_to_int(httponly).to_s+"&expires="+nil_check(expires)+"&sig="+sig
205
205
 
206
206
  result = get(WebServicesBaseURL + "setcookie.ashx?" + qs)
207
207
 
@@ -228,7 +228,7 @@ class GrabzItClient
228
228
  def delete_cookie(name, domain)
229
229
  sig = Digest::MD5.hexdigest(@applicationSecret+"|"+name+"|"+domain+"|1")
230
230
 
231
- qs = "key=" + URI.escape(@applicationKey)+"&domain="+URI.escape(domain)+"&name="+URI.escape(name)+"&delete=1&sig="+sig
231
+ qs = "key=" + CGI.escape(@applicationKey)+"&domain="+CGI.escape(domain)+"&name="+CGI.escape(name)+"&delete=1&sig="+sig
232
232
 
233
233
  result = get(WebServicesBaseURL + "setcookie.ashx?" + qs)
234
234
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grabzit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-12 00:00:00.000000000 Z
12
+ date: 2013-02-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Automatically create and download website screenshots with GrabzIt for
15
15
  free.
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 1.8.23
44
+ rubygems_version: 1.8.24
45
45
  signing_key:
46
46
  specification_version: 3
47
47
  summary: GrabzIt Ruby Client