I want to read the ink level from my printer and the only way (at least that I am aware of) is to access this data through http binding.
The output of the JS file is as following and I am wondering what is the best approach to process this data (e.g. should I use some eval function to actually access the variables, better use regex or something else)?
var inktank=; var g_cur_tank_num=5; var inkCOL = ['InkMaz', 'InkBlk', 'InkYel', 'InkPbk', 'InkCia']; inktank=[0,2,0]; inktank=[1,1,0]; inktank=[2,2,0]; inktank=[3,1,0]; inktank=[4,2,0];
How to read the vars:
The ink tank has 5 cartridges (magenta, black, yellow, pigment black & cyan) and the 2nd value in each inktank object is representing the fill level (magenta = 2, black = 1, yellow = 2, pigment black = 1, cyan = 2).
Thanks in advance for any tips and recommendations on whats the best approach to parse / process these information.