Sha256: 8bfc972c0d0642df91afeccb33db54375720538fd1a836b2bf358a4b0b1b2f78
Contents?: true
Size: 1.63 KB
Versions: 3
Compression:
Stored size: 1.63 KB
Contents
require 'digest/md5' require 'net/http' require 'iconv' module Spider::Messenger module Mobyt def self.parametri(username,password,to,from,testo,operation="TEXT",udh="") #cambio la codifica per gli accenti e caratteri particolari testo_codificato = Iconv.conv('ISO-8859-15', 'UTF-8', testo) string_digest = [username, operation, to, from, testo_codificato, password].map{ |val| val.to_s }.join("") ticket = Digest::MD5.hexdigest(string_digest).downcase hash_parametri = { 'rcpt' => to, 'operation' => operation, 'from' => from, 'data' => testo_codificato, 'id' => username, 'qty' => "h", 'ticket' => ticket, 'udh' => udh } end def self.do_post_request(uri,data) response = Net::HTTP.post_form(uri,data) end def self.check_response_http(response) case response when Net::HTTPSuccess if response.body !~ /^OK/ raise response.body.to_s else return true end else #solleva un eccezione raise response.class.to_s end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
spiderfw-0.6.30 | apps/messenger/lib/backends/mobyt.rb |
spiderfw-0.6.29 | apps/messenger/lib/backends/mobyt.rb |
spiderfw-0.6.28 | apps/messenger/lib/backends/mobyt.rb |