Welcome! Log In Create A New Profile

Advanced

Got network working!!! But can't do fwrite :(

Posted by SteelSLasher 
Re: Got network working!!! But can't do fwrite :(
February 02, 2009 07:16PM
Where's the fun in that! Half the fun is writing the parser :)

ANTLR looks like's it a java thingy. Anyway I've been working on a really simple parser specifically for pulling items from webpages for my radio project. I'm a little ways out from release due to me adding more features but your welcome to reuse the source when I release as a start point for a HTML parser.
Re: Got network working!!! But can't do fwrite :(
February 04, 2009 10:30PM
I have an idea for a parser (its a bit rough and i got confused with PHP halfway):

for(int i=0; i < sizeof(HTML); i++;)
{
if(!tag)
{
if(HTML = "<")
{
var tag = TRUE; //expects tag name next loop
}
else
{
//send text to screen
}
}
else
{
if(isalpha(HTML))
{
strcat ( tagname, HTML);
}
else
if(isspace(HTML))
{
params = TRUE;
}
}
else
if(params)
{
if(HTML !="/" OR HTML !=">"
//slowly add params into array
}
}


Thats some of it and it probably doesnt work anyway. Its obvious this is gonna take ages just to make the parser so i guess patience is needed a lot.

P.S. I need someone who can do GUI since i can t handle graphics on the Wii yet
Re: Got network working!!! But can't do fwrite :(
February 06, 2009 09:11AM
Needs a lot more work. I'll send you my simple parser that retrieves certain div's and specific values from a webpage. Also remember that html is text so you can use functions like strstr and strtok to help you find tags (someone correct me if there is binary data in a html page :) ).

Also don't start off by trying to parse out all the html attributes, you'll get frustrated too quickly. More advice would be to concentrate on html first, don't even attempt to decode script or DHTML. Here's the full HTML set of tags -

[www.w3schools.com]

Once you have something parsing the base HTML tags then work on pulling out the most important attributes like height,width,src and href.

I'll lend a hand with the graphics. I've got a nice template that I use that uses the SDL port with several work-a-arounds.

Email me if you're interested - scanff yahoo com
Re: Got network working!!! But can't do fwrite :(
February 06, 2009 09:36AM
I hate building the GUI but i love designing it and email sent. I would be glad to have a look at your parser. BTW i am using C not C++

Technically SVG isnt really text but a load of hex values but in HTML
Re: Got network working!!! But can't do fwrite :(
February 10, 2009 04:04AM
SVG is still text though, it's XML.
Re: Got network working!!! But can't do fwrite :(
February 13, 2009 08:46PM
Looks like hex to me???
I might not bother with SVGs since they only apear on wiki
Re: Got network working!!! But can't do fwrite :(
February 13, 2009 09:39PM
Hex is text. A representation of binary in a readable format.
Re: Got network working!!! But can't do fwrite :(
February 14, 2009 01:55AM
SVG is XML, which is purely text, not just indecipherable hex values. [www.w3schools.com] But I don't think it's worth implementing in a homebrew web browser.
Re: Got network working!!! But can't do fwrite :(
March 20, 2009 04:10AM
Quote
iofthestorm
SVG is XML, which is purely text, not just indecipherable hex values. [www.w3schools.com] But I don't think it's worth implementing in a homebrew web browser.
I agree. I think that all we need is a program that downloads files from the internet and saves them onto an sd card. Also, a file extractor would be nice.
Re: Got network working!!! But can't do fwrite :(
March 20, 2009 09:25AM
If you just want a program to download files, that would not be too hard. I had written code over winter break to download a specified file but once school started up I got too busy to work any further. I might be able to work on a GUI over spring break and make it so that you can enter a URL and download that file, which should be useful. One problem is that I'm trying to do everything from the ground up rather than use GRRLib/lws so it takes me a while to get stuff done. But my intention is to make a library specifically for making GUI applications that handles some basic input stuff for you, rather than using a sprite library and having to roll your own input detection. So yeah, my break is next week and hopefully you'll see something out of me by the end of next week.
Sorry, only registered users may post in this forum.

Click here to login