Computer Science Canada

Why Can't I View Page Data?

Author:  Anonymous [ Sun May 21, 2006 9:18 pm ]
Post subject:  Why Can't I View Page Data?

Basically in the end I want to find out how to email from Turing, but meanwhile, I've been trying to establish a connection to webpages, which is what I think I have to do. But when I view data, it shows that I've gotten an error, like when I type in a wrong webpage. Or if I enter google.ca or gmail.com, it gives me nothing!

code:

var winID1 := Window.Open ("title: Web Browser")
var url : string
put "Enter the URL to load: " ..
get url

var line : string
put "Connecting to ", url
var netStream := Net.OpenURLConnection (url)

if netStream <= 0 then
    put "Unable to connect to ", url
    return
else
    put "Connected!"
end if
delay (1000)
Window.Close (winID1)

var winID2 := Window.Open ("title: " + url)
var token : string
View.Set ("text")
loop
    exit when eof (netStream)
    get : netStream, line : *
    put line
end loop
Net.CloseConnection (netStream)



Author:  Tony [ Mon May 22, 2006 6:34 am ]
Post subject: 

many sites (including compsci.ca and google) treat bots differently, and that's precisely what your turing executable would register as - a bot. Try this with low traffic sites, see if that makes a difference.


: