Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Web Browser
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DanTheMan




PostPosted: Sun Jun 14, 2009 5:31 pm   Post subject: Web Browser

Hi, DanTheMan here with another question... is it possible to modify Turing code to become a simple web browser? if so, could you post codes?

Just for the record, this is not a school project. This is just curiosity.
Sponsor
Sponsor
Sponsor
sponsor
andrew.




PostPosted: Sun Jun 14, 2009 5:42 pm   Post subject: RE:Web Browser

A while ago I made a Turing program that goes to a web address and gets the html. I forgot what how I did it though and it's not on this computer so I can't really help. But once you figure out how to download the html, you can make your own engine to render the pages.

BTW, I wouldn't recommend doing this. It will not work properly, it's a lot of work, and it won't even compare to any real web browsers.

If you meant like embedding an IE webpage in your program, then no you can't do that.
DtY




PostPosted: Sun Jun 14, 2009 6:28 pm   Post subject: Re: RE:Web Browser

andrew. @ Sun Jun 14, 2009 5:42 pm wrote:
If you meant like embedding an IE webpage in your program, then no you can't do that.

I'd bet you could. IE is built right into windows, and I'm pretty sure any program can attach an IE window into any other window. You'd have to write a C# program or something though, and start it with Sys.Exec()
ecookman




PostPosted: Mon Jun 15, 2009 7:15 am   Post subject: RE:Web Browser

I found some turing programs that do stuff over the local network (a chatroom i forget by who)

Although it works, it is painfully slow. Trying to make a webbrowser it might work, but it will probaly be so slow you'd think you are on dialup when it first came out on a computer with 2kb or ram.

If you are trying to get rid of the (i have) Bess block or website block, a browser change won't do it.
Tony




PostPosted: Mon Jun 15, 2009 12:12 pm   Post subject: RE:Web Browser

as it was mentioned, you could use Net module to download web pages, and then interpret them in a way that you want. Turing's Net is known to be buggy and/or slow, so a faster alternative might be to use something like curl to fetch the content, and then read from a local file.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
DanTheMan




PostPosted: Tue Jun 16, 2009 8:50 am   Post subject: RE:Web Browser

Well... I dunno what to say...
andrew.




PostPosted: Tue Jun 16, 2009 3:45 pm   Post subject: Re: RE:Web Browser

DtY @ Sun Jun 14, 2009 6:28 pm wrote:
andrew. @ Sun Jun 14, 2009 5:42 pm wrote:
If you meant like embedding an IE webpage in your program, then no you can't do that.

I'd bet you could. IE is built right into windows, and I'm pretty sure any program can attach an IE window into any other window. You'd have to write a C# program or something though, and start it with Sys.Exec()
Yeah, but then you'd be running a C# program not a Turing one. I think he wanted to have IE in his actual Turing run window.
DtY




PostPosted: Tue Jun 16, 2009 6:29 pm   Post subject: Re: RE:Web Browser

andrew. @ Tue Jun 16, 2009 3:45 pm wrote:
DtY @ Sun Jun 14, 2009 6:28 pm wrote:
andrew. @ Sun Jun 14, 2009 5:42 pm wrote:
If you meant like embedding an IE webpage in your program, then no you can't do that.

I'd bet you could. IE is built right into windows, and I'm pretty sure any program can attach an IE window into any other window. You'd have to write a C# program or something though, and start it with Sys.Exec()
Yeah, but then you'd be running a C# program not a Turing one. I think he wanted to have IE in his actual Turing run window.

That's what I'm talking about, I think you can make a program attach an IE frame in any window (even ones that program didn't create).

I remember a stealth program that would put one in whatever window was active, that you could hide with a quick key stroke. The name escapes me though.
Sponsor
Sponsor
Sponsor
sponsor
DanTheMan




PostPosted: Tue Jun 16, 2009 6:30 pm   Post subject: RE:Web Browser

Either that, or just a turing window that has a web address bar that you can type into and open up the page in a web browser.
DtY




PostPosted: Tue Jun 16, 2009 6:34 pm   Post subject: Re: RE:Web Browser

DanTheMan @ Tue Jun 16, 2009 6:30 pm wrote:
Either that, or just a turing window that has a web address bar that you can type into and open up the page in a web browser.

Hmm.. To open a page in a webbrowser, try:
Turing:
Sys.Exec("URL of webpage")

That might work (Can't remember if windows associates web addresses with the browser), if not it might be:
Turing:
Sys.Exec("explorer.exe 'path to webpage'")


[edit] The first should work, that's one of the examples on the help page: http://compsci.ca/holtsoft/doc/sys_exec.html
Dan




PostPosted: Tue Jun 16, 2009 9:30 pm   Post subject: Re: RE:Web Browser

[quote="DtY @ 16th June 2009, 6:29 pm"][quote="andrew. @ Tue Jun 16, 2009 3:45 pm"]
DtY @ Sun Jun 14, 2009 6:28 pm wrote:

I'd bet you could. IE is built right into windows, and I'm pretty sure any program can attach an IE window into any other window.


Turing lacks any access to the windows or IE API so it can not attach an IE window only open one but thats rather pointless (as you could open it in firefox or there default browser the same way).

Turing would still have no access to any of the content or pages being viewed in the browser and by no means would it be a web browser in Turing. It could be good to spam the user into viewing your webpage but it's not very partical for anything else.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
DtY




PostPosted: Wed Jun 17, 2009 6:23 am   Post subject: Re: RE:Web Browser

[quote="Dan @ Tue Jun 16, 2009 9:30 pm"][quote="DtY @ 16th June 2009, 6:29 pm"]
andrew. @ Tue Jun 16, 2009 3:45 pm wrote:
DtY @ Sun Jun 14, 2009 6:28 pm wrote:

I'd bet you could. IE is built right into windows, and I'm pretty sure any program can attach an IE window into any other window.


Turing lacks any access to the windows or IE API so it can not attach an IE window only open one but thats rather pointless (as you could open it in firefox or there default browser the same way).

Which is why, if you could do it, you'd have to write it in another language, and start it with Sys.Exec()
DanTheMan




PostPosted: Wed Jun 17, 2009 11:33 am   Post subject: RE:Web Browser

I just got an idea.

What I needed to do was just print the HTML on turing, so I have to find a way to print it. I made a program that opens the file and prints it on the screen, but I need to make it recognise the tags and print them on the screen.

code:

var fileNo : int
var ch : char

open : fileNo, "HTML.txt", get
loop
    get : fileNo, ch
    put ch ..
    if eof (fileNo) then
        exit
    end if
end loop
close : fileNo
DtY




PostPosted: Wed Jun 17, 2009 11:47 am   Post subject: RE:Web Browser

If you want just very basic rendering, make it read until it gets to <body>, then print every character it does not between < and >.
Then, if you feel up to it, make <br> and <br /> end the line, <em> and <strong> change foreground colour, etc.
Dan




PostPosted: Wed Jun 17, 2009 12:57 pm   Post subject: Re: RE:Web Browser

DtY @ 17th June 2009, 6:23 am wrote:

Which is why, if you could do it, you'd have to write it in another language, and start it with Sys.Exec()


Witch makes the turing program just a short cut for a web broswer you wrote in another langue, you might as well skip turing all togther.


DanTheMan wrote:

What I needed to do was just print the HTML on turing, so I have to find a way to print it. I made a program that opens the file and prints it on the screen, but I need to make it recognise the tags and print them on the screen.


Going from HTML to the visual rendering you get with a browser is not a trival problem and would be a masive undertaking even for a basic text based browser.

If you realy want to make your own web broswer i recomend ditching turing and going to a langue that can use permade web browser engines like WebKit.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: