i believe all programmers doubt their skill from time to time and so have i now
mostly posting because i'm bored at work, doing some regexp at home to parse some machine generated html, we all know how that goes
basically to avoid spaghetti code i'm doing it in several stages, this produces more loops but it keeps the code clean because it might be used and edited by others
so basically i get the html code, localize the specific line my required info is in because it is machine generated it all ends up on one line lol
then i split that one line up, since it's a html table i replace <\/?tr> with \n so i get each row of the table where my data is by itself
then i'm confused as to what is the best approach, at this point i split at <\/?td> and put each line into an array which i loop through and gather the info i need in a more structured hash from which i can later fetch info with predefined values used as keys
Name:
Anonymous2008-10-30 5:08
Your skill at the shift key sucks.
Also, regexbuddy. Now you have three problems.
thanks for that but the project is cancelled now anyways, i'll keep page2rss in my bookmarks
turns out the info on the webpage i was parsing was not up to date and my whole idea failed with this
Name:
Anonymous2008-10-30 13:50
Serious answer, I did this for a screenscraping project before:
Shove the HTML through Lynx to render it to a normal text file, then parse that.
Name:
Anonymous2008-10-30 14:05
Fuck you guys are awful programmers.
Unless you are writing a web browser from scratch, you should not be writing an HTML parser yourself. Google didn't even write an HTML parser from scratch for Chrome, they used WebKit. So maybe you should too.
HTML is described by a DOM. So load your HTML in to some DOM object (WebKit, IE or write a FireFox plugin to get the DOM out) and find your table rows by traversing it.
If the page is valid XHTML and you want to make it in to an RSS feed then you just apply an XSLT to it that does that, and forget the fucking rest.
>>8
hey that's a really nice idea, i'm gonna remember that for later
Name:
Anonymous2009-03-06 8:27
problem is with the furious stroking that he on his desktop C Despite numerous reformats his computer has been through the right way to manage and protect new elements without the user mode bullshit!
Name:
Anonymous2009-03-06 13:35
The other day and everything you write a program in the mind then let it all but tap the pad and then I beat Metal Slug 3 on.