This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

special caracter incurve script creation
#1
Hi,
I have a script to create the curve easily.
It work perfect/

My problem is about password, if my customer use special caracter like @ it doesn't work.
I tried to replace with %40 ...
ASCII/UNICODE... @ %40 @ Alt 64

example:

password= xxxXxxx%40yyyYyy

without sucess.
Any help apreciated

Code:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
---------------------------- -- creer la courbe function createCurve(adresse, classement)   if adresse then     require('json')     require('socket.url')     require('socket.http')     -- parameters     daily = 365*24*60 -- 1 day     daily1year = 365*24*12 -- 365 day     daily2year = 2*365*24*12 -- 365 day     year5_d = 5*365 -- 5 year     trend_type = 'C' -- C is counter, D is counter with neg. delta, G is absolute value         object = adresse         if grp.find(adresse) then             --separe nom du cpt pour mettre que le libelle dans nom des courbes       nom_compteur=grp.alias(adresse)       nom_compteur_split=string.split(nom_compteur,'-')                 -- si pas total, on separe       if nom_compteur_split[4] then         zone=string.gsub(nom_compteur_split[2],'CPTTD_','')         nom_compteur=zone..'-'..nom_compteur_split[5]       end             trend = {         object = knxlib.encodega(object), -- object id in db         name = nom_compteur, -- trend name         type = trend_type,         resolution = 60, -- every 5 minute         precision = 1, -- floating point precision         count_resolution = 365*24*12, -- 1 year         count_daily = 5*365, -- 5 years         category = classement       }       data = json.encode(trend)       post = 'data=' .. socket.url.escape(data)             --auth=require('mime').b64('admin:'..password)             --res, err = socket.http.request('http://'..auth..'@127.0.0.1/scada-main/trends/save', post)       res, err = socket.http.request('http://admin:'..password..'@127.0.0.1/scada-main/trends/save', post)       sleep(1)       if err then         log(res, err)       end     end   end  end ---------------------------
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT
Reply


Messages In This Thread
special caracter incurve script creation - by domotiqa - 03.12.2021, 15:25

Forum Jump: