This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Google Search
Started by Hydrotronics, 21 December 2015 - 11:32 AMPosted 21 December 2015 - 12:32 PM
While waiting for my post within my other post to be answered I went to designing HydrOS's search engine. Well, i haven't really got far. I managed to get a bunch of HTML in my face, but no way of actually filtering through that and making it into something readable. So, I was wondering how I would be able to get the HTML code of say a google search and filter that into content which is understandable?
Posted 21 December 2015 - 02:16 PM
Sounds like you will be working with a browser like program for CC (only text, eventually links).
Use patterns, but I don't know which ones, since I don't speak HTML.
Use patterns, but I don't know which ones, since I don't speak HTML.
Posted 21 December 2015 - 04:12 PM
Parsing HTML is ridiculously difficult. I'd bet you need some patterns, but also some tokens and such. Part of the problem is everything being defined relatively - in HTML, I can make 3 text boxes without specifying where any of them are, and the HTML parser will have to figure out where to put them.
Posted 21 December 2015 - 04:20 PM
how would i code HTML in CC? or does CC support HTML? because all i know CC supports is Lua and maybe Java
Posted 21 December 2015 - 04:44 PM
CC supports Lua. Someone wrote a program that translates Java to Lua, so you can use Java. CC does not support HTML
Posted 21 December 2015 - 04:59 PM
then… how would i translate the HTML to Lua/Java? You said something about patterns? what are patterns? XD I'm new to some of these coding terms
Posted 21 December 2015 - 05:13 PM
HTML is a markup language, Lua and Java are programming languages.
Markup languages tell a computer what something should look like, programming languages tell a computer how to do something.
You will need a HTML parser in order to use HTML in CC. You cannot program in HTML.
Markup languages tell a computer what something should look like, programming languages tell a computer how to do something.
You will need a HTML parser in order to use HTML in CC. You cannot program in HTML.
Posted 21 December 2015 - 06:26 PM
you know what would be much simpler? is if i just made a place on a server where you can add your own information to add to the google search. This would probably be easier, but less reliable. I don't really want to go through all the trouble of making an HTML parser etc. as I have no idea where to start or how I'm going to do it :/
Posted 21 December 2015 - 06:29 PM
If you plan on supporting HTML, you may as well write a parser for JS/PHP as well. Many websites use JavaScript and/or PHP as well as HTML. And then you'll need an image parser to handle any pictures.
By the way, oeed tried to do this. Last time I checked it was non-functional though.
By the way, oeed tried to do this. Last time I checked it was non-functional though.
Posted 21 December 2015 - 06:31 PM
Yah i don't think i'll be doing that any time soon… I'm not exactly a pro in HTML in the first place :P/>
Edited on 21 December 2015 - 05:31 PM
Posted 21 December 2015 - 10:45 PM
Yah i don't think i'll be doing that any time soon… I'm not exactly a pro in HTML in the first place :P/>/>
If it helps, I have a very.. "Basic" HTML parser, which DOES work, and it will parse HTML into a lua table :D/> I was using it, but decided against it :P/>, If you are interested PM me :D/> I am working on a web engine.
Posted 22 December 2015 - 12:11 AM
Isn't there a Google JSON API?
Posted 22 December 2015 - 08:52 AM
Isn't there a Google JSON API?
I do think there is, I assume it might be paid though?:s No idea…