Copy link to clipboard
Copied
hi,
any one in here wouldn't know how to parse cfhttp results like:
[RESPONSE]
PROPERTY[TOTAL][0]=15
PROPERTY[FIRST][0]=0
PROPERTY[DOMAIN][0]=somedomain.org
PROPERTY[DOMAIN][1]=someotherdomain.be
PROPERTY[DOMAIN][2]=yetanotherdomain.com
........
PROPERTY[DOMAIN][14]=andanotherone.be
PROPERTY[COUNT][0]=15
PROPERTY[LAST][0]=14
PROPERTY[LIMIT][0]=10000
DESCRIPTION=Command completed successfully
CODE=200
QUEUETIME=0
RUNTIME=0.036
EOF
or has a clue how to write a script to work with hexonet ?
Copy link to clipboard
Copied
Its sort of hacky, but you could use regular expressions to convert the data into a multi-delimited format to be able to parse with CF. something like this:
<cfset sDelimFormat = ReReplaceNoCase(CFHTTP.FileContent, "PROPERTY\[([^\]]+)\]\[([0-9]+)]=([^\n]*)", "\1,\2=\3", "all")>
You'll get something like this:
TOTAL,0=15
FIRST,0=0
DOMAIN,0=somedomain.org
DOMAIN,1=someotherdomain.be
DOMAIN,2=yetanotherdomain.com
DOMAIN,14=andanotherone.be
COUNT,0=15
LAST,0=14
LIMIT,0=10000
DESCRIPTION=Command completed successfully
CODE=200
Although I'm sure the regex deities hanging around the board could probably work out some magic pattern to convert the format into JSON, which would be really slick.
Copy link to clipboard
Copied
it's indeed sort of hacky... i have a few other connection possibilities, but don't have a clue how to start with those... cfr: