Hi guys
First of all, Marry Christmas. :)
I'm developing a gadget for Vista Sidebar but I think that it's much better to explane my problem here.
Take some random webpage, for ex. www.microsoft.com. I would like to create a script function that automatically delete first 50 lines and last 50 lines of html code of that page (I want my gadget to show only middle part). Is there any way to make something like this
Thanks in advance

Function to edit html code of a webpage
Randy R
My goal Just to create some useful gadget for Sidebar that allow people to search on Wikipedia and display results in non-very-large Flyout (that's why I need to get only useful information, I just don't have enough space for menu/frame stuff). Wanna add some other interesting functions too, I think people will like it (at least I hope). :)
At this moment I'm trying css style approach, but links you've provided are very interesting too, wanna try that way too (probably gonna use blinkbits since it's recommended).
Thank you very much, your reply was very helpful. :)
AndersBank
Since you're building a Sidebar gadget, you probably ought to post in the Sidebar forum.
As for truncating the source of a web page, it really depends on the page, how you're displaying it, how you're retrieving data, etc. The standard web gadget approach would be to find or create an RSS feed for the web site that contains just the information you want rather than trying to pull out the data from the page. That way you can avoid the question of what a "line of html code" actually is. If you just blindly remove the first 50 and last 50 lines of code, you might inadvertently remove the entire page (for a small web site) or end up with undisplayable content (open tags without close tags, close tags without open tags, <tr> or <td> tags without corresponding <table> tags, <li> tags without the opening or closing <ol> or <ul> tags, etc). That's a huge issue if you're planning on actually rendering the code. If you just want to show the source, it'll still be pretty nasty since you'll be missing large amounts of important structural data.
Oh yeah, and I'd prefer not to marry Christmas. I'm not sure that's legal in any country :) (lame jab at "merry" vs. "marry". Sorry, but I had to do it)
Mad_Box
My first approach would be to find an RSS feed of wikipedia data, like http://www.blinkbits.com/wikifeeds.php. For example, here's a feed for the Widget_Engine wikipedia article: http://www.blinkbits.com/en_wikifeeds_rss/widget_engine. The text is not well-formatted, so you may have to parse through it and add your own markup. BTW, the blinkbits feed appears to be the recommended method of getting this data. Note that Wikipedia disallows crawling/screen scraping, which means your current approach is not a good idea.
If you need more than that, you can get database dumps yourself and do your own server-side parsing of the data.
And that's just for Wikipedia. Other web sites may have other ways of retrieving data, but screen scraping (loading the HTML and parsing that out for specific bits of data) is generally frowned upon.
What exactly is your goal for this gadget Knowing the ultimate goal, someone here or in the Sidebar forum may be able to suggest a different/better approach than the road you're currently going down.
varunsagii
Maybe you're right and it would be better to extract information I need rather than delete information I don't need, but still, I have no idea how to do it.
Let's take some real problem (I'm developing Wiki gadget), random Wikipedia article. Suppose that I need to extract only useful information (only the main article, no frame at right/top/bottom). How can I do it Css Script
I believe that this is a right forum for my question because I think you guys are more practical with web stuff, so, I'm in your hands. :)
Thanks again