Note that there are some explanatory texts on larger screens.

plurals
  1. POGet variable from web page with javascript in C++ Builder
    text
    copied!<p>I have a MiFi modem (Huawei e5776) which comes with its own web page that displays total traffic per month. I want to extract this value and display a meter in the icon tray. I'm sure this is possible in C++ Builder (or Delphi) but even though I'm pretty experienced in using C++ Builder, I am not in anything web related. Can someone give me some pointers how to do this? I assume I need to run the script and then extract the variable somewhere, how do I do this?</p> <p>Thanks.</p> <p>PS: I'd add the contents of the page but can't see a way to attach a document. Here's the first few lines..</p> <pre><code>// JavaScript Document var g_monitoring_traffic_statistics = null; var g_wlan_security_settings = null; var g_wlan_basic_settings = null; var g_connection_trafficresponse = null; //Prefix string of ssid2 of Multi-SSID var g_prefixWifiSsid = "ssid2_"; function getTrafficInfo(bit) { var final_number = 0; var final_str = ""; if(g_monitoring_dumeter_kb &gt; bit) { final_number = formatFloat(parseFloat(bit), 2); final_str = final_number + " B"; } else if(g_monitoring_dumeter_kb &lt;= bit &amp;&amp; g_monitoring_dumeter_mb &gt; bit) { final_number = formatFloat(parseFloat(bit) / g_monitoring_dumeter_kb, 2); final_str = final_number + " KB"; } else if(g_monitoring_dumeter_mb &lt;= bit &amp;&amp; g_monitoring_dumeter_gb &gt; bit) { final_number = formatFloat((parseFloat(bit) / g_monitoring_dumeter_mb), 2); final_str = final_number + " MB"; } else if(g_monitoring_dumeter_gb &lt;= bit &amp;&amp; g_monitoring_dumeter_tb &gt; bit) { final_number = formatFloat((parseFloat(bit) / g_monitoring_dumeter_gb), 2); final_str = final_number + " GB"; } else { final_number = formatFloat((parseFloat(bit) / g_monitoring_dumeter_tb), 2); final_str = final_number + " TB"; } return final_str; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload