[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Help for reader for NETGEAR DG834GT

Enzo Crasi

7/30/2006 8:57:00 PM

Hi.

I don't find the error
this script should read the SNR margin of my adsl line from router and
write it on txt file...
like this but without window
http://img159.imageshack.us/my.php?image...


but there is an error in the script
Can you help me?

require 'open-uri'

log = File.new("stats.log", "a+")
data = []

while true do
i = 0
open(
"http://192.168.0.1/stattbl.html",:http_basic_authentic...["username",
"password"] ).each do |page|
page.each do |html|
case html
when /<span.*>.*kbps<\/span>/
html.each { |line|
line.sub(/<span.*>(.*)kbps/) { data[i] = $1.strip }
}
i+=1
end
end
end
log.write "SNR: down(#{data[0]}) up(#{data[1]}) -- #{Time.now.to_s}\n"
sleep 3
end
log.close


the error is

c:/ruby/lib/ruby/1.8/net/http.rb:2003:in `each_response_header': wrong
header line format (Net::HTTP
BadResponse)
from c:/ruby/lib/ruby/1.8/net/http.rb:1977:in `read_new'
from c:/ruby/lib/ruby/1.8/net/http.rb:1044:in `request'
from c:/ruby/lib/ruby/1.8/open-uri.rb:261:in `open_http'
from c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
from c:/ruby/lib/ruby/1.8/open-uri.rb:245:in `open_http'
from c:/ruby/lib/ruby/1.8/open-uri.rb:629:in `buffer_open'
from c:/ruby/lib/ruby/1.8/open-uri.rb:167:in `open_loop'
from c:/ruby/lib/ruby/1.8/open-uri.rb:165:in `open_loop'
from c:/ruby/lib/ruby/1.8/open-uri.rb:135:in `open_uri'
from c:/ruby/lib/ruby/1.8/open-uri.rb:531:in `open'
from c:/ruby/lib/ruby/1.8/open-uri.rb:86:in `open'
from reader.rb:8


thnks

--
Posted via http://www.ruby-....

4 Answers

Enzo Crasi

7/31/2006 4:37:00 PM

0

:(


>
> the error is
>
> ............
>
>
> thnks

--
Posted via http://www.ruby-....

Enzo Crasi

8/5/2006 7:21:00 AM

0

can anybody give an hand?

please


--
Posted via http://www.ruby-....

Chris Gehlker

8/5/2006 12:38:00 PM

0


On Aug 5, 2006, at 12:20 AM, Enzo Crasi wrote:

> can anybody give an hand?

We don't know what you want. Almost everything can be configured by
simply pointing your browser to routerlogin.net and working from there.

---
Neither a man nor a crowd nor a nation can be trusted to act humanely
or to think sanely under the influence of a great fear.

-Bertrand Russell, philosopher, mathematician, author, Nobel laureate
(1872-1970)



Enzo Crasi

8/5/2006 2:00:00 PM

0

Chris Gehlker wrote:
> On Aug 5, 2006, at 12:20 AM, Enzo Crasi wrote:
>
>> can anybody give an hand?
>
> We don't know what you want. Almost everything can be configured by
> simply pointing your browser to routerlogin.net and working from there.
>
> ---
> Neither a man nor a crowd nor a nation can be trusted to act humanely
> or to think sanely under the influence of a great fear.
>
> -Bertrand Russell, philosopher, mathematician, author, Nobel laureate
> (1872-1970)

first of all thanks for the answer

then
> We don't know what you want.

sorry, maybe it's my fault
I want that script run on windows by ruby and made a file with this
line (like example) on it:

SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:53:51 CEST 2006
SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:53:57 CEST 2006
SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:54:02 CEST 2006
SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:54:08 CEST 2006
SNR: down(23.4 db), up(7.5 db) -- sab ago 5 15:54:13 CEST 2006

but it gave me an error.I don't find it! :cry:

>Almost everything can be configured by
> simply pointing your browser to routerlogin.net and working from there.

sorry but don't understand

--
Posted via http://www.ruby-....