Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sinatra/Ruby:
- get '/getstats' do
- `sh /var/www/netspeed.sh wlan4`
- "test"
- end
- HTML:
- var xmlhttp2=new XMLHttpRequest();
- xmlhttp2.open("GET","http://"+new_ip+":/getstats",true);
- xmlhttp2.setRequestHeader('Authorization', 'Basic 4=');
- xmlhttp2.send();
- xmlhttp2.onreadystatechange = function() {
- if (xmlhttp2.readyState == 4 ) {
- bandwidth_var.value = xmlhttp2.responseText;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement