lib/Baidupush/base.rb in Baidupush-0.0.1 vs lib/Baidupush/base.rb in Baidupush-0.0.2
- old
+ new
@@ -32,13 +32,13 @@
keys = keys.sort
keys.each do |key|
str += "#{key}=#{params[key]}"
end
str += "#{secertkey}"
- p "**STR:#{str}"
+ #p "**STR:#{str}"
str = CGI::escape(str)
- p "**Str: #{str}"
+ #p "**Str: #{str}"
sign = Digest::MD5.hexdigest(str)
sign
end
def self.https_get(url,args)
@@ -68,10 +68,9 @@
def self.http_get(url,args)
uri = URI.parse(url)
uri.query = URI.encode_www_form(args)
- p "URL : #{uri}"
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
time_start = Time.now.to_i
response = http.request(request)
time_end = Time.now.to_i
\ No newline at end of file